#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a); i >= (b); --i)
#define sz(a) int((a).size())
#define pconent(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;
const ll MOD =  1e9+7;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
inline ll isqrt(ll k) {ll r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}
inline int sign(ld x) {return x < -EPS ? -1 : x > +EPS;}
inline int sign(ld x, ld y) {return sign(x - y);}
#define db(v) (cout<<#v<<" = "<<v<<endl)
#define endln (cout<<endl)
template <class T> inline void dbv(T a) {  for(auto x : a){ cout<<x<<", " ;} cout<<endl;}
vector<vector<pair<ll,ll> > >g;
pair<vector<ll>,vector<ll> > dijkstra(ll x)
{
    ll n = g.size();
    vector<ll> d(n,LINF);
    vector<ll> par(n,-1);
    d[x] = 0;
    priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>> q;
    q.push(mp(0,x));
    while(!q.empty())
    {
        pair<ll,ll> p = q.top();
        q.pop();
        ll u = p.second;
        ll dist = p.first;
        if(dist > d[u]) 
        {
            continue;
        }
        for(auto pr : g[u]) 
        {
            ll v = pr.fi;
            ll next_dist = dist + pr.se;
            if(next_dist<d[v])
            {
                d[v] = next_dist;
                par[v] = u;
                q.push(mp(next_dist,v));
            }
        }
    }
    return mp(d,par);
}
void output(ll tx)
{
    ll n,m,s,t;
    cin>>n>>m>>s>>t;
    vector<pair<ll,ll> > edges(m);
    vector<ll> a(m);
    vector<ll> b(m);
    FOR(i,0,m)
    {
        cin>>edges[i].fi>>edges[i].se>>a[i]>>b[i];
        edges[i].fi--;
        edges[i].se--;
    }
    s--; t--;
    g.clear();
    g.resize(n);
    FOR(i,0,m)
    {
        g[edges[i].fi].pb(mp(edges[i].se,a[i]));
        g[edges[i].se].pb(mp(edges[i].fi,a[i]));
    }
    vector<ll> v1 = dijkstra(s).fi;
    g.clear();
    g.resize(n);
    FOR(i,0,m)
    {
        g[edges[i].fi].pb(mp(edges[i].se,b[i]));
        g[edges[i].se].pb(mp(edges[i].fi,b[i]));
    }
    vector<ll> v2 = dijkstra(t).fi;
    ll ans = LINF;
    vector<ll> poss(n);
    FOR(i,0,n)
    {
        poss[i] = v1[i]+v2[i];
    }
    vector<ll> cumm(n);
    cumm[n-1] = poss[n-1];
    FORd(i,n-2,0)
    {
        cumm[i] = min(cumm[i+1],poss[i]);
    }
    FOR(i,0,n)
    {
        cout<<(ll)(1e15-cumm[i])<<endl;
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t =1;
    // cin>>t;
    FOR(i,0,t)
    {
        output(i+1) ;
    }
    return 0 ;
}

Measured memory_bytes: 18448