// Slower C++ solution:
#include<queue>

#include<cstdio>

#include<vector>

#include<cstring>

#include<algorithm>

using namespace std;



#define MAXN 100000

int N,M;

struct Edge{

    int v,w[2];

    Edge(){}

    Edge(int a,int w1,int w2){

        v=a,w[0]=w1,w[1]=w2;

    }

};

vector<Edge> G[MAXN+5];



bool vis[MAXN+5];

long long dist[2][MAXN+5];

void SPFA(int S,int opt){

    memset(vis,0,sizeof vis);

    memset(dist[opt],0x3f,sizeof dist[opt]);

    queue<int> Q;Q.push(S);

    dist[opt][S]=0;vis[S]=1;

    while(!Q.empty()){

        int u=Q.front();

        vis[u]=0;Q.pop();

        for(int i=0;i<int(G[u].size());i++){

            int v=G[u][i].v,w=G[u][i].w[opt];

            if(dist[opt][v]>dist[opt][u]+w){

                dist[opt][v]=dist[opt][u]+w;

                if(!vis[v]){

                    vis[v]=1;

                    Q.push(v);

                }

            }

        }

    }

}



long long Ans[MAXN+5];

int main(){

    int S,T;

    scanf("%d%d%d%d",&N,&M,&S,&T);

    for(int i=1;i<=M;i++){

        int u,v,w1,w2;

        scanf("%d%d%d%d",&u,&v,&w1,&w2);

        G[u].push_back(Edge(v,w1,w2));

        G[v].push_back(Edge(u,w1,w2));

    }

    SPFA(S,0);

    SPFA(T,1);

    Ans[N]=dist[0][N]+dist[1][N];

    for(int i=N-1;i>=1;i--)

        Ans[i]=min(Ans[i+1],dist[0][i]+dist[1][i]);

    for(int i=1;i<=N;i++)

        printf("%lld\n",1000000000000000ll-Ans[i]);

}


// Faster C++ solution for the same problem (measured speedup: 1.4896601882276856x):
/*Lucky_Glass*/

#include<cstdio>

#include<cstring>

#include<algorithm>

#include<iostream>

#include<cmath>

#include<vector>

#include<queue>

using namespace std;

const int MAXN=1e5;

struct EDGE{

	int v,val[2];

	EDGE(){}

	EDGE(int c,int d,int e){v=c;val[0]=d;val[1]=e;}

};

int n_cty,n_edg,s,t;

vector<EDGE>lnk[MAXN+5];

long long dist[2][MAXN+5],ans[MAXN+5];//0:yen start->i   1:snuuk end->i

bool vis[MAXN+5];

void SPFA(int start,int kind)

{

	memset(vis,0,sizeof vis);

	fill(dist[kind],dist[kind]+n_cty+3,1e15);

	queue<int> que;que.push(start);

	dist[kind][start]=0;vis[start]=true;

	while(!que.empty())

	{

		int u=que.front();que.pop();

		for(int i=0;i<lnk[u].size();i++)

		{

			int v=lnk[u][i].v,val=lnk[u][i].val[kind];

			if(dist[kind][v]>dist[kind][u]+val)

			{

				dist[kind][v]=dist[kind][u]+val;

				if(!vis[v])

					vis[v]=true,que.push(v);

			}

		}

		vis[u]=false;

	}

}

struct DEQUE{

	int val,date;

	DEQUE(){}

	DEQUE(int a,int b){val=a;date=b;}

};

int main()

{

	scanf("%d%d%d%d",&n_cty,&n_edg,&s,&t);

	for(int i=0;i<n_edg;i++)

	{

		int u,v,a,b;scanf("%d%d%d%d",&u,&v,&a,&b);

		lnk[u].push_back(EDGE(v,a,b));

		lnk[v].push_back(EDGE(u,a,b));

	}

	SPFA(s,0);

	SPFA(t,1);

	fill(ans+1,ans+n_cty+3,1e15);

	for(int i=n_cty;i>=1;i--)

	{

		long long val=dist[0][i]+dist[1][i];

		ans[i]=min(ans[i+1],val);

	}

	for(int i=1;i<=n_cty;i++)

		printf("%lld\n",(long long)1e15-ans[i]);

	/*

	deque<DEQUE> low;

	for(int i=1;i<=n_cty;i++)

	{

		int val=dist[0][i]+dist[1][i];

		while(!low.empty() && low.back().val>val) low.pop_back();

		low.push_back(DEQUE(val,i));

	}

	for(int i=1;i<=n_cty;i++)

	{

		while(!low.empty() && low.front().date<i) low.pop_front();

		printf("%lld\n",(long long)1e15-low.front().val);

	}

	*/

	return 0;

}