#include<cstdio>
#include<cstring>
#include<queue>
using namespace std;
#define INF 1e18
#define N 100005
int n,m,s,t;
long long f=1e15;
long long ans[N];
struct node//学到老，回到老>.< 
{
	struct Edge
	{
		int next;
		int to;
		long long dis;
	}edge[N+5];
	
	int cnt=0;
	int head[N],vis[N];
	long long dis[N];
	void add(int from,int to,long long dis)
	{
		edge[++cnt].next=head[from];
		edge[cnt].to=to;
		edge[cnt].dis=dis;
		head[from]=cnt;
	}
	
	queue<int >Q;
	
	void SPFA(int s)
	{
		for(int i=1;i<=n;i++)
		dis[i]=INF;
		memset(vis,0,sizeof vis);
		Q.push(s);
		vis[s]=1;
		dis[s]=0;
		while(!Q.empty())
		{
			int x=Q.front();
			Q.pop();
			vis[x]=0;
			for(int i=head[x];i;i=edge[i].next)
			{
				int to=edge[i].to;
				if(dis[to]>dis[x]+edge[i].dis)
				{
					dis[to]=dis[x]+edge[i].dis;
					if(!vis[to]) Q.push(to),vis[to]=1;
				}
			}
		}
	}
}G1,G2;
int main()
{
	scanf("%d %d %d %d",&n,&m,&s,&t);
	int u,v;
	long long a,b;
	for(int i=1;i<=m;i++)
	{
		scanf("%d %d %lld %lld",&u,&v,&a,&b);
		G1.add(u,v,a);
		G1.add(v,u,a);
		G2.add(u,v,b);
		G2.add(v,u,b);
	}
	G1.SPFA(s);
	G2.SPFA(t);
	ans[n+1]=INF;
	for(int i=n;i>=1;i--)
	ans[i]=min(ans[i+1],G1.dis[i]+G2.dis[i]);
	for(int i=1;i<=n;i++)
	printf("%lld\n",f-ans[i]);
 } 