// Slower C++ solution:
#include<bits/stdc++.h> //Ithea Myse Valgulious

namespace chtholly{

typedef long long ll;

#define re0 register int

#define rec register char

#define rel register ll

#define gc getchar

#define pc putchar

#define p32 pc(' ')

#define pl puts("")

/*By Citrus*/

inline int read(){

  int x=0,f=1;char c=gc();

  for (;!isdigit(c);c=gc()) f^=c=='-';

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return f?x:-x;

  }

template <typename mitsuha>

inline bool read(mitsuha &x){

  x=0;int f=1;char c=gc();

  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';

  if (!~c) return 0;

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return x=f?x:-x,1;

  }

template <typename mitsuha>

inline int write(mitsuha x){

  if (!x) return 0&pc(48);

  if (x<0) x=-x,pc('-');

  int bit[20],i,p=0;

  for (;x;x/=10) bit[++p]=x%10;

  for (i=p;i;--i) pc(bit[i]+48);

  return 0;

  }

inline char fuhao(){

  char c=gc();

  for (;isspace(c);c=gc());

  return c;

  }

}using namespace chtholly;

using namespace std;

#define yi first

#define er second

typedef pair<ll,ll> pll;

typedef vector<ll> vlt;

const ll inf=1e18;

const int yuzu=1e5;

int n=read(),m=read(),s=read(),t=read();

 

struct edge{int to;ll cost;};

vector<edge> lj[2][yuzu|10];

 

vlt pao(int s,int id){

priority_queue<pll,vector<pll>,greater<pll> > q;

vlt d(n+2,inf);

d[s]=0,q.push(pll(0,s));

for (;!q.empty();){

  pll p=q.top();q.pop();

  int v=p.er;

  if (d[v]>=p.yi){

    for (edge e:lj[id][v]){

      if (d[e.to]>d[v]+e.cost){

        d[e.to]=d[v]+e.cost;

        q.push(pll(d[e.to],e.to));

	    } 

	  }

    }

  }return d;

}

 

int main(){

int i;

for (i=1;i<=m;++i){

  int u=read(),v=read();ll a=read(),b=read();

  lj[0][u].push_back(edge{v,a});

  lj[0][v].push_back(edge{u,a});

  lj[1][u].push_back(edge{v,b});

  lj[1][v].push_back(edge{u,b});

  }

vlt gmy=pao(s,0),xhk=pao(t,1),ans(n+2,inf);

for (i=n;i;--i) ans[i]=min(gmy[i]+xhk[i],ans[i+1]);

ll llx=1e15;

for (i=1;i<=n;++i) write(llx-ans[i]),pl;

}

// Faster C++ solution for the same problem (measured speedup: 1.7693444422954188x):
/*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;

}