#include<bits/stdc++.h>

using namespace std;
using ll = long long;
const ll INF = 1e18;

vector<ll> dijkstra(int N,int start,int dest,const vector<vector<pair<ll,ll>>>& Hen){
    vector<ll> dist(N, INF), prever(N, -1), seen(N);
    dist[start] = 0;
    priority_queue<pair<ll,ll>, vector<pair<ll,ll>>, greater<pair<ll,ll>>> que;
    que.emplace(0, start);

    while(que.size()) {
        ll ver = que.top().second, cost = que.top().first; que.pop();
        if(seen[ver])continue;
        seen[ver] = true;
        for(auto i : Hen[ver]) {
            if(dist[i.first] > cost + i.second) {
                dist[i.first] = cost + i.second;
                prever[i.first] = ver;
                que.emplace(dist[i.first], i.first);
            }
        }
    }
    return dist;
}


int main()
{
    int n, m, s, t; cin >> n >> m >> s >> t; s--, t--;
    vector<vector<pair<ll,ll>>> en(n), sn(n);
    for(int i = 0; i < m; i++) {
        int u, v, a, b;
        cin >> u >> v >> a >> b; u--, v--;
        en[u].emplace_back(v, a); en[v].emplace_back(u, a);
        sn[u].emplace_back(v, b); sn[v].emplace_back(u, b);
    }
    vector<ll> sta = dijkstra(n, s, t, en);
    vector<ll> end = dijkstra(n, t, s, sn);

    ll nax = 0, def = 1e15;
    vector<ll> cost(n);
    for(int i = n - 1; i >= 0; i--) {
        nax = max(nax, def - (sta[i] + end[i]));
        cost[i] = nax;
    }
    for(int i = 0; i < n; i++)cout << cost[i] << endl;
}