#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
	
using namespace std;

typedef long long ll;
typedef pair<int,ll> edge;
typedef pair<ll,int> P;
const ll INF=1e18;

const int MAX_N=1e5,MAX_M=1e5;
int N,M,S,T;
vector<edge> G[MAX_N][2];
ll dist[MAX_N][2];

void dijkstra(int i){
	int s;
	if (i==0){
		s=S;
	}else{
		s=T;
	}
	REP(v,N){
		dist[v][i]=INF;
	}
	dist[s][i]=0;
	priority_queue<P,vector<P> ,greater<P> > pque;
	pque.push(P(0,s));
	while(!pque.empty()){
		P p=pque.top();
		pque.pop();
		int v=p.second;
		if (dist[v][i]<p.first){
			continue;
		}
		REP(j,(int)G[v][i].size()){
			edge e=G[v][i][j];
			if (dist[e.first][i]>dist[v][i]+e.second){
				dist[e.first][i]=dist[v][i]+e.second;
				pque.push(P(dist[e.first][i],e.first));
			}
		}
	}
}

int main(){
	cin>>N>>M>>S>>T;
	S--;
	T--;
	REP(i,M){
		int u,v,a,b;
		cin>>u>>v>>a>>b;
		u--;
		v--;
		G[u][0].push_back(edge(v,a));
		G[v][0].push_back(edge(u,a));
		G[u][1].push_back(edge(v,b));
		G[v][1].push_back(edge(u,b));
	}
	dijkstra(0);
	dijkstra(1);
	vector<ll> vans(N);
	ll ans=0;
	for(int i=N-1;i>=0;i--){
		ans=max(ans,(ll)1e15-dist[i][0]-dist[i][1]);
		vans[i]=ans;
	}
	REP(i,N){
		cout<<vans[i]<<endl;
	}
	return 0;
}