#include<bits/stdc++.h>
using namespace std;
long long dis1[100001],dis2[100001],ans[100001];
vector<pair<long long,long long> > adj1[100001],adj2[100001];
int main(){
	int n,m,s,t;
	scanf("%d%d%d%d",&n,&m,&s,&t);
	while (m--){
		 long long x,y,a,b;
		 scanf("%lld%lld%lld%lld",&x,&y,&a,&b);
		 adj1[x].push_back(make_pair(y,a));adj1[y].push_back(make_pair(x,a));
		 adj2[x].push_back(make_pair(y,b));adj2[y].push_back(make_pair(x,b));
	}
	memset(dis1,0x7f,sizeof(dis1));
	memset(dis2,0x7f,sizeof(dis2));
	priority_queue<pair<long long,long long> > q;
	dis1[s]=0;
	q.push(make_pair(0,s));
	while (!q.empty()){
		long long x=q.top().second;q.pop();
		for (int i=0;i<adj1[x].size();i++){
			long long y=adj1[x][i].first,z=adj1[x][i].second+dis1[x];
			if (dis1[y]>z){
				dis1[y]=z;
				q.push(make_pair(-dis1[y],y));
			}
		}
	}
	dis2[t]=0;
	q.push(make_pair(0,t));
	while (!q.empty()){
		long long x=q.top().second;q.pop();
		for (int i=0;i<adj2[x].size();i++){
			long long y=adj2[x][i].first,z=adj2[x][i].second+dis2[x];
			if (dis2[y]>z){
				dis2[y]=z;
				q.push(make_pair(-dis2[y],y));
			}
		}
	}
	ans[n+1]=dis1[0];
	for (int i=n;i;i--) ans[i]=min(ans[i+1],dis1[i]+dis2[i]);
	for (int i=1;i<=n;i++) printf("%lld\n",((long long)(1e15+1e-8))-ans[i]);
	return 0;
}