// 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: 3.573475273341626x):
//SPFA

#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]);

}