//code by lynmisakura.wish to be accepted!
#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
 
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>
 
/***************************/
using namespace std;
 
typedef long long ll;
typedef vector<ll> vi;
typedef vector<long long> vl;
typedef pair<ll, ll> pi;
typedef vector<pair<ll, ll> > vpi;
 
//const long long INF = 1LL << 55;
 
#define itn ll
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ss second
#define ff first
#define dup(x,y) ((x) + (y) - 1)/(y)
#define mins(x,y) x = min(x,y)
#define maxs(x,y) x = max(x,y)
#define all(x) (x).begin(),(x).end()
#define Rep(n) for(ll i = 0;i < n;i++)
#define rep(i,n) for(ll i = 0;i < n;i++)
#define flush fflush(stdout)
#define rrep(i,n) for(ll i = n - 1;i >= 0;i--)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define ioboost cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20)
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll qp(ll a, ll b) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
ll qp(ll a, ll b, ll mo) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }
const int MaxN=10000010,mod=998244353;
int fac[MaxN*2],ifac[MaxN*2];
long long inv(int a,int p=mod){return a==1?1:(1+p*(a-inv(p%a,a)))/a%p;}
int C(int n,int m){return m<0||m>n?0:1ll*fac[n]*ifac[m]%mod*ifac[n-m]%mod;}
 
#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

ll n,m,s,t;

const ll INF = 1e16;
vector<vector<pair<ll, ll>>> adj_y;
vector<ll> d(200020),p(200020);
void dijkstra(ll s, vector<ll> & d, vector<ll> & p) {
    ll n = adj_y.size();
    d.assign(n, INF);
    p.assign(n, -1);
    
    d[s] = 0;
    using pii = pair<ll, ll>;
    priority_queue<pii, vector<pii>, greater<pii>> q;
    q.push({0, s});
    while (!q.empty()) {
        ll v = q.top().second;
        ll d_v = q.top().first;
        q.pop();
        if (d_v != d[v])
            continue;
        
        for (auto edge : adj_y[v]) {
            ll to = edge.first;
            ll len = edge.second;
            
            if (d[v] + len < d[to]) {
                d[to] = d[v] + len;
                p[to] = v;
                q.push({d[to], to});
            }
        }
    }
}
vector<vector<pair<ll, ll>>> adj_s;
vector<ll> d2(200020),p2(200020);
void dijkstra2(ll s, vector<ll> & d, vector<ll> & p) {
    ll n = adj_s.size();
    d.assign(n, INF);
    p.assign(n, -1);
    
    d[s] = 0;
    using pii = pair<ll, ll>;
    priority_queue<pii, vector<pii>, greater<pii>> q;
    q.push({0, s});
    while (!q.empty()) {
        ll v = q.top().second;
        ll d_v = q.top().first;
        q.pop();
        if (d_v != d[v])
            continue;
        
        for (auto edge : adj_s[v]) {
            ll to = edge.first;
            ll len = edge.second;
            
            if (d[v] + len < d[to]) {
                d[to] = d[v] + len;
                p[to] = v;
                q.push({d[to], to});
            }
        }
    }
}
int main(void){
    
    cin >> n >> m >> s >> t;
    s--,t--;
    adj_y.resize(n);
    adj_s.resize(n);
    rep(i,m){
        ll a,b,c,d;
        cin >> a >> b >> c >> d;
        a--,b--;
        adj_y[a].pb(mp(b,c));
        adj_y[b].pb(mp(a,c));
        adj_s[a].pb(mp(b,d));
        adj_s[b].pb(mp(a,d));
    }
    
    dijkstra(s,d,p);
    dijkstra2(t,d2,p2);
    
    vector<ll> d3(200020);
    for(ll i = 0;i < n;i++){
        d3[i] = d[i] + d2[i];
    }
    
    vector<ll> ans(200020,(ll)1e16);
    ll mincost = LONG_MAX;
    for(ll i = n - 1;i >= 0;i--){
        mins(mincost,d3[i]);
        ans[i] = mincost;
    }
    for(int i = 0;i < n;i++){
        cout << (ll)(1e15) - ans[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 26108