#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------
struct edge {ll to, cost;};
typedef pair<ll , ll> P;
const ll MAX_V = 100100;
const ll INF = 100000000000000000;
ll V,E;
vector<edge> G1[MAX_V], G2[MAX_V];
ll d1[MAX_V];
ll d2[MAX_V];
void init(){
    ll i;
    FOR(i, MAX_V){
        d1[i]=INF;
        d2[i]=INF;
    }
}

void dijkstra1(ll s){
    priority_queue<P, vector<P> ,greater<P>> que;
    d1[s]=0;
    que.push(P(0,s));
    while(!que.empty()){
        P p = que.top();que.pop();
        ll v = p.second;
        if(d1[v] < p.first) continue;
        for(ll i = 0; i<G1[v].size(); i++){
            edge e=G1[v][i];
            if(d1[e.to]>d1[v]+e.cost){
                d1[e.to]=d1[v] + e.cost;
                que.push(P(d1[e.to],e.to));
            }
        }
    }
}

void dijkstra2(ll s){
    priority_queue<P, vector<P> ,greater<P>> que;
    d2[s]=0;
    que.push(P(0,s));
    while(!que.empty()){
        P p = que.top();que.pop();
        ll v = p.second;
        if(d2[v] < p.first) continue;
        for(ll i = 0; i<G2[v].size(); i++){
            edge e=G2[v][i];
            if(d2[e.to]>d2[v]+e.cost){
                d2[e.to]=d2[v] + e.cost;
                que.push(P(d2[e.to],e.to));
            }
        }
    }
}


void solve() {
    ll i,j,k,l,r,x,y,u,v,a,b;
    ll S,T;
    bool exit = false; 
    cin>>V>>E>>S>>T; 
    S--;
    T--;
    init();
    FOR(i,E){
        cin>>u>>v>>a>>b;
        u--;
        v--;
        edge e;
        e.to=v;
        e.cost=a;
        G1[u].push_back(e);
        e.to=u;
        e.cost=a;
        G1[v].push_back(e);


        e.to=v;
        e.cost=b;
        G2[u].push_back(e);
        e.to=u;
        e.cost=b;
        G2[v].push_back(e);
    }

    dijkstra1(S);
    dijkstra2(T);
    vector <ll> ret;
    FOR(i,V){
        ll cand = 1000000000000000 - (d1[(V-1)-i]+d2[(V-1)-i]);
        if (i==0){
            ret.insert(ret.begin(), cand);
            //cout<<"ccc"<<ret[0]<<endl;
            continue;
        }
        if(ret[0] > cand){
            ret.insert(ret.begin(),ret[0] );
            //cout<<"aaa"<<ret[0]<<endl;
        }else{
            ret.insert(ret.begin(), cand);
            //cout<<"bbb"<<ret[0]<<endl;
        }
    }
    FORR(i,ret)
        cout<<i<<endl;
    /*cin>>N;
    vector<ll> V;
    FOR(x,N+1) {
            FOR(y,N+1) {
                    ll ret=1;
                    FOR(i,x) ret*=2;
                    FOR(i,y) ret*=5;
                    V.push_back(ret);
            }
    }
    sort(ALL(V));
    FORR(v,V) cout<<v<<endl;*/
}


int main(int argc,char** argv){
    string s;int i;
    if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
    FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
    cout.tie(0); solve(); return 0;
}



Measured memory_bytes: 20092