#include <bits/stdc++.h>
#define LL long long
#define INF 1e18
#define MAXN 100005
 
LL min(LL x, LL y) {if(x<y) return x; return y;}
 
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];
	
	std::queue<int> q;
	
	void addedge(int from, int to, LL dis)
	{
		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; 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.addedge(u, v, a); g1.addedge(v, u, a);
		g2.addedge(v, u, b); g2.addedge(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]);
}