#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;
int d1[100010],d2[100010];
struct edge {
    int to,cost;
};
vector<edge>G1[100010],G2[100010];
int V;
void dijkstra1(int s) {
	priority_queue<pair<int,int>, vector<pair<int,int>>, greater<pair<int,int>>>que;
	fill(d1, d1 + V, 9999999999999999);
	d1[s] = 0;
	que.push({0, s});
	while (!que.empty()) {
       // cerr<<cnt<<endl;
		pair<int,int> p = que.top(); que.pop();
		int v = p.second;
		if (d1[v] < p.first)continue;
		for (int i = 0; i < G1[v].size(); i++) {
			edge e = G1[v][i];
			if (d1[e.to] > d1[v] + e.cost) {
				d1[e.to] = d1[v] + e.cost;
				que.push({d1[e.to], e.to});
			}
		}
	}
}

void dijkstra2(int s) {
	priority_queue<pair<int,int>, vector<pair<int,int>>, greater<pair<int,int>>>que;
	fill(d2, d2 + V, 9999999999999999);
	d2[s] = 0;
	que.push({0, s});
	while (!que.empty()) {
		pair<int,int> p = que.top(); que.pop();
		int v = p.second;
		if (d2[v] < p.first)continue;
		for (int i = 0; i < G2[v].size(); i++) {
			edge e = G2[v][i];
			if (d2[e.to] > d2[v] + e.cost) {
				d2[e.to] = d2[v] + e.cost;
				que.push({d2[e.to], e.to});
			}
		}
	}
}

ll res[100010];
signed main(){
    int n,m,s,t;
    cin>>n>>m>>s>>t;
    s--,t--;
    V=n;
    for (int i = 0; i < m; i++)
    {
        int u,v,a,b;
        cin>>u>>v>>a>>b;
        u--,v--;
        G1[u].push_back({v,a});
        G1[v].push_back({u,a});
        G2[u].push_back({v,b});
        G2[v].push_back({u,b});
        
    }
    //cerr<<G1[0].size()<<endl;;
    //show(G1[0]);
    dijkstra1(s);
    dijkstra2(t);
    //cerr<<d1[0]<<endl;
    ll ans[100010];
    fill(ans,ans+n,1e16);
    ans[n-1]=d1[n-1]+d2[n-1];
   // cerr<<ans[n-1]<<endl;
    for (int i = 0; i <n-1; i++)
    {
       ans[n-2-i]=min(ans[n-i-1], d1[n-i-2]+d2[n-i-2]);
    }
    for (int i = 0; i < n; i++)
    {
        cout<<1000000000000000-ans[i]<<"\n";
    }
    

    return 0;
}

Measured memory_bytes: 19140