#include <bits/stdc++.h>
using namespace std;

#define NDEBUG
#ifdef DEBUG
#include "../cout11.h"
#undef NDEBUG
#endif
#include <cassert>

typedef long long ll;
typedef pair<int,int> ii;


typedef vector<int> vi;
typedef vector<vector<int>> vvi;


#define sz(a)  int((a).size())
#define pb  push_back
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define ALL(c)  (c).begin(),(c).end()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define cons make_pair


const ll INF = LLONG_MAX/3;

template <typename T>
void make_adjacent(int nV, vector<pair<ii,T>>& arcs, vector<vector<pair<int,T>>>& adj) {
	adj.resize(nV);
	for (pair<ii, T> p: arcs) {
		int u = p.first.first, v = p.first.second;
		assert(u != v);
		T distance = p.second;
		adj[u].push_back(make_pair(v, distance));
		adj[v].push_back(make_pair(u, distance));
	}
}

template <typename T>
void dij1(int nV, vector<vector<pair<int,T>>>& adjacent, vector<T>& d, int start) {
	// nV: |V|
	d.assign(nV, INF);
	d[start] = 0;
	vector<int> prev(nV, -1);

	priority_queue<pair<T, int>> Q;
	Q.push(make_pair(0, start));

	vector<bool> visited(nV, false);

	while (!Q.empty()) {
		T du = -Q.top().first;
		int u = Q.top().second; Q.pop();
		if (visited[u]) continue;
		visited[u] = true;

		int c = adjacent[u].size();
		for (int i=0; i<c; ++i) {
			int v = adjacent[u][i].first;
			T distance = adjacent[u][i].second;
			T alt = du + distance;
			if (d[v] > alt) {
				d[v] = alt;
				prev[v] = u;
				Q.push(make_pair(-alt, v));
			}
		}
	}
}

// template <typename T>
// void dij(int nV, vector<vector<pair<int,T>>>& adjacent, vector<vector<T>>& d) {
// 	d.resize(nV);
// 	for (int start=0; start<nV; ++start) {
// 		dij1(nV, adjacent, d[start], start);
// 	}
// }


void solve(int n,int m,int s,int t, vi& u, vi& v, vi& a, vi& b){
    vector<ll> dY(n), dS(n);

    vector<pair<ii,ll>> arcsY(m), arcsS(m);
    rep(i,m){
        ii arc(u[i], v[i]);
        arcsY[i] = cons(arc, (ll)a[i]);
        arcsS[i] = cons(arc, (ll)b[i]);
    }
    // cerr << arcsY << endl;
    // cerr << arcsS << endl;
    vector<vector<pair<int,ll>>> adjY, adjS;
    make_adjacent(n, arcsY, adjY);
    make_adjacent(n, arcsS, adjS);
    // cerr << adjY << endl;
    // cerr << adjS << endl;
    dij1(n, adjY, dY, s);
    dij1(n, adjS, dS, t);
#ifdef DEBUG
    cerr << dY << endl;
    cerr << dS << endl;
#endif
    priority_queue<pair<ll,int>> pq;
    rep(i,n){
        pq.push(cons(-(dY[i]+dS[i]), 1+i));
    }
    rep(i,n){
        ll cost = -1;
        while (!pq.empty()) {
            auto t = pq.top();
            int expiration = t.second;
            if (i >= expiration) {
                pq.pop();
                continue;
            }
            cost = -t.first;
            break;
        }
        if (cost == -1) {
            cost = dY[t];
        }
        // fprintf(stderr, "i=%d; cost=%lld\n", i, cost);
        cout << 1000000000000000LL - cost << endl;
    }
}

int main() {
    int n,m,s,t;
    cin >> n >> m >> s >> t;
    --s; --t;
    vi u(m),v(m),a(m),b(m);
    rep(i,m) {
        cin >> u[i] >> v[i] >> a[i] >> b[i];
        --u[i]; --v[i];
    }
    solve(n,m,s,t, u,v,a,b);
    return 0;
}


Measured memory_bytes: 25072