#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<ll,ll>P;

vector<P>E[200000],G[200000];
ll d[200000],e[200000];
int main(){
	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--;
		E[u].push_back(P(a,v));E[v].push_back(P(a,u));
		G[u].push_back(P(b,v));G[v].push_back(P(b,u));
	}
	priority_queue<P,vector<P>,greater<P>>que;
	memset(d,0x3f,sizeof(d));
	d[s]=0;que.push(P(0,s));
	while(!que.empty()){
		P p=que.top();que.pop();
		if(d[p.second]!=p.first)continue;
		for(auto u:E[p.second]){
			if(d[u.second]>p.first+u.first){
				d[u.second]=p.first+u.first;
				que.push(P(d[u.second],u.second));
			}
		}
	}
	memset(e,0x3f,sizeof(e));
	e[t]=0;que.push(P(0,t));
	while(!que.empty()){
		P p=que.top();que.pop();
		if(e[p.second]!=p.first)continue;
		for(auto u:G[p.second]){
			if(e[u.second]>p.first+u.first){
				e[u.second]=p.first+u.first;
				que.push(P(e[u.second],u.second));
			}
		}
	}
	deque<P>v;
	rep(i,n){
		v.push_back(P(d[i]+e[i],i));
	}
	sort(v.begin(),v.end());
	ll C=1e15;
	rep(i,n){
		while(v.front().second<i)v.pop_front();
		printf("%lld\n",C-v.front().first);
	}
}