// Slower C++ solution:
#include "bits/stdc++.h"

using namespace std;

#define ll long long int

#define rep(i,n) for( int i = 0; i < n; i++ )

#define rrep(i,n) for( int i = n; i >= 0; i-- )

#define REP(i,s,t) for( int i = s; i <= t; i++ )

#define RREP(i,s,t) for( int i = s; i >= t; i-- )

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define INF 2000000000

#define mod 1000000007

#define INF2 1000000000000000000

#define int long long



struct edge { int to, cost; };

typedef pair<int, int> P;



int V;

vector<edge> G[100010];

vector<edge> Z[100010];

int d[100010];

int ST[100010];

int GL[100010];

int u[100010];

int v[100010];

int a[100010];

int b[100010];





void dijkstra(int s) {

	priority_queue<P, vector<P>, greater<P> > que;

	fill(d, d + V + 1, INF2);

	d[s] = 0;

	que.push(P(0, s));



	while (!que.empty()) {

		P p = que.top(); que.pop();

		int v = p.second;

		if (d[v] < p.first) continue;

		for (int i = 0; i < G[v].size(); i++) {

			edge e = G[v][i];

			if (d[e.to] > d[v] + e.cost) {

				d[e.to] = d[v] + e.cost;

				que.push(P(d[e.to], e.to));

			}

		}

	}

}



void dijkstra2(int s) {

	priority_queue<P, vector<P>, greater<P> > que;

	fill(d, d + V + 1, INF2);

	d[s] = 0;

	que.push(P(0, s));



	while (!que.empty()) {

		P p = que.top(); que.pop();

		int v = p.second;

		if (d[v] < p.first) continue;

		for (int i = 0; i < Z[v].size(); i++) {

			edge e = Z[v][i];

			if (d[e.to] > d[v] + e.cost) {

				d[e.to] = d[v] + e.cost;

				que.push(P(d[e.to], e.to));

			}

		}

	}

}



signed main(void)

{

    cin.tie(0);

    ios::sync_with_stdio(false);

	int n, m, s, t;

	cin >> n >> m >> s >> t;

	V = n;

	rep(i, m) cin >> u[i] >> v[i] >> a[i] >> b[i];



	rep(i, m) {

		G[u[i]].push_back({ v[i], a[i] });

		G[v[i]].push_back({ u[i], a[i] });

		Z[u[i]].push_back({ v[i], b[i] });

		Z[v[i]].push_back({ u[i], b[i] });

	}

	dijkstra(s);

	rep(i, n) ST[i + 1] = d[i + 1];

	dijkstra2(t);

	rep(i, n) GL[i + 1] = d[i + 1];

	int ans[n + 1];

	rep(i, n + 1) ans[i] = INF2;

	ans[n] = ST[n] + GL[n];

	rrep(i, n) ans[i - 1] = min(ans[i], ST[i - 1] + GL[i - 1]);

	rep(i, n) {

		// cout << i + 1 << " " << ST[i + 1] + GL[i + 1] << " " << ans[i + 1] << endl;

		cout << (int)(pow(10, 15) + 0.5) - ans[i + 1] << endl;

	}





    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.1898074351370709x):
#include "bits/stdc++.h"

using namespace std;

#define ll long long int

#define rep(i,n) for( int i = 0; i < n; i++ )

#define rrep(i,n) for( int i = n; i >= 0; i-- )

#define REP(i,s,t) for( int i = s; i <= t; i++ )

#define RREP(i,s,t) for( int i = s; i >= t; i-- )

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define INF 2000000000

#define mod 1000000007

#define INF2 100000000000000000

#define int long long

int ans[2][100010];

typedef pair<int, int> P;

typedef pair<int, P> PP;

vector<PP> G[100010];





void dijkstra(int s, int kind) {

    priority_queue<P, vector<P>, greater<P> > que;

    rep(j, 100010) ans[kind][j] = INF2;

    ans[kind][s] = 0;

    que.push(P(0, s));



    while (!que.empty()) {

        P p = que.top(); que.pop();

        int v = p.second;

        if (ans[kind][v] < p.first) continue;

        for (int i = 0; i < G[v].size(); i++){

            P e;

            e.first = G[v][i].first;

            if (kind == 0) e.second= G[v][i].second.first;

            else e.second = G[v][i].second.second;

            if (ans[kind][e.first] > ans[kind][v] + e.second) {

                ans[kind][e.first] = ans[kind][v] + e.second;

                que.push(P(ans[kind][e.first], e.first));

            }

        }

    }

}



signed main(void)

{

    cin.tie(0);

    ios::sync_with_stdio(false);

    int n, m, s, t; cin >> n >> m >> s >> t;

    s--; t--;

    rep(i, m) {

        int u, v, a, b;

        cin >> u >> v >> a >> b;

        u--; v--;

        G[u].push_back({v, {a, b}});

        G[v].push_back({u, {a, b}});

    }

    dijkstra(s, 0);

    dijkstra(t, 1);



    int k = INF2;

    vector<int> output;

    rrep(i, n - 1) {

        k = min(k, ans[0][i] + ans[1][i]);

        output.push_back(1000000000000000 - k);

    }

    rrep(i, n - 1) cout << output[i] << endl;





    return 0;

}