#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#include <numeric>
#define IINF 1000000000
#define INF 3223372036854775807
#define MOD 1000000007
#define mod 1000000007
#define INT_MAX_ 2147483647
#define EPS (1e-10)
#define REP(i, a, n) fo-r (ll i = a; i < (ll)(n); i++)
#define REPE(i, a, n) for (ll i = a; i <= (ll)(n); i++)
//#define rep(i,n)for (ll i = 0; i < (ll)(n); i++)
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
#define me memset
#define bit(n,k) ((n>>k)&1)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int,int>Pin;
typedef pair<ll,ll>Pll;
template<class T> using V=vector<T>;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
#define invp(a,p)pom(a,p-2,p)
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
ll cmp1(pair<ll,ll> a,pair<ll,ll> b){
        if(a.fi!=b.fi)
        return a.fi<b.fi;
        else
        return a.se>b.se;
}
ll cmp(ll a,ll b){
    return abs(a)<abs(b);
}
//----------------------------------------------------------------------
#define WHITE 0
#define GRAY 1
#define BLACK 2

ll n;
vector<pair<ll,ll>>adj1[100010];
vector<pair<ll,ll>>adj2[100010];//邻接表表示法
ll D1[100010];
ll D2[100010];
void dijkstraplus1(ll s){
    priority_queue<Pll > pq;
    int color[100010];
    ll d[100010];
    for(int i=0;i<n;i++){
        d[i]=INF;
        color[i]=WHITE;
    }
    d[s]=0;
    pq.push(make_pair(0,s));//pq和adj里面的元素是反的
    color[s]=GRAY;
    while(!pq.empty()){
        Pll f=pq.top();
        pq.pop();
        ll u=f.second;
        color[u]=BLACK;
        if(d[u]<f.first*(-1)) //pq是从大到小所以要*-1 如果不是最小路径则忽略
            continue;
        for(int j=0;j<adj1[u].size();j++){
            ll v=adj1[u][j].first;
            if(color[v]==BLACK)
                continue;
            if(d[v]>d[u]+adj1[u][j].second){
                d[v]=d[u]+adj1[u][j].second;
                pq.push(make_pair(d[v]*(-1),v));
                color[v]=GRAY;
            }
        }
    }
    for(ll i=0;i<n;i++){
        D1[i]=d[i];
    }
}
void dijkstraplus2(ll s){
    priority_queue<Pll > pq;
    int color[100010];
    ll d[100010];
    for(int i=0;i<n;i++){
        d[i]=INF;
        color[i]=WHITE;
    }
    d[s]=0;
    pq.push(make_pair(0,s));//pq和adj里面的元素是反的
    color[s]=GRAY;
    while(!pq.empty()){
        Pll f=pq.top();
        pq.pop();
        ll u=f.second;
        color[u]=BLACK;
        if(d[u]<f.first*(-1)) //pq是从大到小所以要*-1 如果不是最小路径则忽略
            continue;
        for(int j=0;j<adj2[u].size();j++){
            ll v=adj2[u][j].first;
            if(color[v]==BLACK)
                continue;
            if(d[v]>d[u]+adj2[u][j].second){
                d[v]=d[u]+adj2[u][j].second;
                pq.push(make_pair(d[v]*(-1),v));
                color[v]=GRAY;
            }
        }
    }
    for(ll i=0;i<n;i++){
        D2[i]=d[i];
    }
}
//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------  
    //ll begin_t=clock();
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //------------------------------
    ll m,s,t;cin>>n>>m>>s>>t;
    s--;t--;
    for(ll i=0;i<m;i++){
        ll u,v,a,b;cin>>u>>v>>a>>b;
        u--;v--;
        adj1[u].pb(mp(v,a));
        adj1[v].pb(mp(u,a));
        adj2[u].pb(mp(v,b));
        adj2[v].pb(mp(u,b));
    }
    ll D[100010];
    dijkstraplus1(s);
    dijkstraplus2(t);
    for(ll i=0;i<n;i++){
        D[i]=1000000000000000-D1[i]-D2[i];
    }
    ll maxD=D[n-1];
    for(ll i=n-2;i>=0;i--){
        if(D[i]<maxD){
            D[i]=maxD;
        }
        else{
            chmax(maxD,D[i]);
        }
    }
    for(ll i=0;i<n;i++){
        cout<<D[i]<<endl;
    }
    //------------------------------
    //fclose(stdin);
    //fclose(stdout);
    //ll end_t=clock();cout<<"time="<<end_t-begin_t<<"ms"<<endl;
    //------------------------------- 
    return 0;
}
//----------------------------------------------------------------------






















































Measured memory_bytes: 22432