// 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.187750371714294x):
#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]);

}