#include <cstdio>
#include<algorithm>
#include<queue>
#include<cstring>
using namespace std;
#define LL long long
#define INF 1e18
#define MAXN 100002
int n,m,s,t,u,v;
LL a,b,f=1e15,ans[MAXN];
struct Graph
{
	int cnt,head[MAXN],vis[MAXN];
	LL dis[MAXN];
	struct Edge{int next,to;LL dis;}edge[MAXN*2];
	queue<int> q;
	void add(int from,int to,LL dis)//在struct定义本质不变
	{
		edge[++cnt].next=head[from];
		edge[cnt].to=to;
		edge[cnt].dis=dis;
		head[from]=cnt;
	}
	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!=0;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);
	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(v,u,b);g2.add(u,v,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]);
}