#include <bits/stdc++.h>

using namespace std;

#define llong long long int
#define ldouble long double
#define rep(i, n) for (int i = 0; i < n; ++i)
#define repr(i, n) for (int i = n; i >= 0; --i) 
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()

typedef vector<int> VI;
typedef vector<llong> VL;
typedef vector<pair<int, int> > VPI;
typedef vector<pair<llong, llong> > VPL;

const static int MOD = 1000000000 + 7;
const static int INT_INF = 999999999;
const static llong INF = 1LL << 60;
const static double eps = 1e-6;
const static int dx[] = {1, 0, -1, 0};
const static int dy[] = {0, 1, 0, -1};

int n, m, s, t;
vector<vector<pair<int, llong> > > G_yen, G_snuke;
VL cost_from_start_yen, cost_from_goal_snuke;

void dijkstra(int s, int id) {
    priority_queue<pair<llong, int>, vector<pair<llong, int> >, greater<pair<llong, int> > > que;

    if (id == 0) {
        fill(all(cost_from_start_yen), INF);
        cost_from_start_yen[s] = 0;
        que.push(make_pair((llong)0, s));

        while (! que.empty()) {
            pair<llong, int> p = que.top();
            que.pop();
            int v = p.second;
            if (cost_from_start_yen[v] < p.first) continue;
            rep(i, G_yen[v].size()) {
                pair<int, llong> e = G_yen[v][i];
                if (cost_from_start_yen[e.first] > cost_from_start_yen[v] + e.second) {
                    cost_from_start_yen[e.first] = cost_from_start_yen[v] + e.second;
                    que.push(make_pair(cost_from_start_yen[e.first], e.first));
                }
            }
        }
    } else {
        fill(all(cost_from_goal_snuke), INF);
        cost_from_goal_snuke[s] = 0;
        que.push(make_pair((llong)0, s));

        while (! que.empty()) {
            pair<llong, int> p = que.top();
            que.pop();
            int v = p.second;
            if (cost_from_goal_snuke[v] < p.first) continue;
            rep(i, G_snuke[v].size()) {
                pair<int, llong> e = G_snuke[v][i];
                if (cost_from_goal_snuke[e.first] > cost_from_goal_snuke[v] + e.second) {
                    cost_from_goal_snuke[e.first] = cost_from_goal_snuke[v] + e.second;
                    que.push(make_pair(cost_from_goal_snuke[e.first], e.first));
                }
            }
        }
    }
}

signed main (int argc, char *argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin >> n >> m >> s >> t;
    --s, --t;
    G_yen.resize(n), G_snuke.resize(n), cost_from_start_yen.resize(n), cost_from_goal_snuke.resize(n);
    rep(i, m) {
        int u, v;
        llong a, b;
        cin >> u >> v >> a >> b;
        --u, --v;
        G_yen[u].push_back(make_pair(v, a));
        G_yen[v].push_back(make_pair(u, a));
        G_snuke[u].push_back(make_pair(v, b));
        G_snuke[v].push_back(make_pair(u, b));
    }

    dijkstra(s, 0);
    dijkstra(t, 1);

    VL ans;
    llong max_cost = -10000000000000000LL;
    rep(i, n) {
        llong res = 1000000000000000LL - cost_from_start_yen[n - i - 1] - cost_from_goal_snuke[n - i - 1];
        if (res > max_cost) max_cost = res;
        ans.push_back(max_cost);
    }
    /*
    rep(i, n) {
        cout << cost_from_start_yen[i] << endl;
    }
    cout << endl;
    rep(i, n) {
        cout << cost_from_goal_snuke[i] << endl;
    }
    */

    rep(i, n) {
        cout << ans[n - i - 1] << endl;
    }

    return 0;
}

Measured memory_bytes: 19964