#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

struct City{
    int d,v;
    bool operator<(const City&right)const{return d>right.d;}
};
struct Edge{int to,len;};

int n,m,s,t,d1[100009],d2[100009],ans[100009];
vector<Edge> yen[100009],snuuk[100009];

signed main(){
    cin>>n>>m>>s>>t;
    rep(i,m){
        int u,v,a,b;
        cin>>u>>v>>a>>b;
        yen[u].push_back({v,a});
        yen[v].push_back({u,a});
        snuuk[u].push_back({v,b});
        snuuk[v].push_back({u,b});
    }
    rep(i,n+1)d1[i]=d2[i]=1e18;
    priority_queue<City> que;
    que.push({0,s});
    d1[s]=0;
    while(!que.empty()){
        City c=que.top();
        que.pop();
        if(d1[c.v]<c.d)continue;
        rep(i,yen[c.v].size()){
            if(d1[yen[c.v][i].to]>c.d+yen[c.v][i].len){
                d1[yen[c.v][i].to]=c.d+yen[c.v][i].len;
                que.push({d1[yen[c.v][i].to],yen[c.v][i].to});
            }
        }
    }
    que.push({0,t});
    d2[t]=0;
    while(!que.empty()){
        City c=que.top();
        que.pop();
        if(d2[c.v]<c.d)continue;
        rep(i,snuuk[c.v].size()){
            if(d2[snuuk[c.v][i].to]>c.d+snuuk[c.v][i].len){
                d2[snuuk[c.v][i].to]=c.d+snuuk[c.v][i].len;
                que.push({d2[snuuk[c.v][i].to],snuuk[c.v][i].to});
            }
        }
    }
    for(int i=n;i;i--)ans[i]=max(ans[i+1],(int)1e15-d1[i]-d2[i]);
    rep(i,n)cout<<ans[i+1]<<endl;
}