#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define rpd(i,a,b) for(int i=a;i>=b;--i)
#define ll long long
#define pb push_back
using namespace std;
const int N=1e5+5;
const ll INF=1e15;
inline int read(){
    int x=0,f=1;char ch=getchar();
    while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
    while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,m,S,T,tot;
int head[N],nxt[N<<1],to[N<<1],b[N<<1][3];
ll dis[N][3],ans[N],Min=INF;
bool v[N];
void add(int u,int v,int w0,int w1)
{nxt[++tot]=head[u];head[u]=tot;to[tot]=v;b[tot][0]=w0;b[tot][1]=w1;}
void dfs(int s,int k){
	rep(i,1,n)dis[i][k]=INF,v[N]=0;
	dis[s][k]=0;v[s]=1;queue<int>Q;Q.push(s);
	while(!Q.empty()){
		int k1=Q.front();Q.pop();v[k1]=0;
		for(int i=head[k1];i;i=nxt[i]){
			int p=to[i];
			if(dis[p][k]<=dis[k1][k]+b[i][k])continue;
			dis[p][k]=dis[k1][k]+b[i][k];
			if(v[p])continue;v[p]=1;Q.push(p);
		}
	}
}
int main(){
	n=read();m=read();S=read();T=read();
	rep(i,1,m){
	    int u=read(),v=read(),w0=read(),w1=read();
		add(u,v,w0,w1);add(v,u,w0,w1);
	}
	dfs(S,0);dfs(T,1);
	rpd(i,n,1){
		ll now=dis[i][0]+dis[i][1];
		Min=min(Min,now);
		ans[i]=Min;
	}
	rep(i,1,n){
		ll now=1e15;
		printf("%lld\n",now-ans[i]);
	}
	return 0;
}
