#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;

#define REP(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

template< typename Monoid >
struct SegmentTree {
  using F = function< Monoid(Monoid, Monoid) >;
 
  ll sz;
  vector< Monoid > seg;
 
  const F f;
  const Monoid M1;
 
  SegmentTree(ll n, const F f, const Monoid &M1) : f(f), M1(M1) {
    sz = 1;
    while(sz < n) sz <<= 1;
    seg.assign(2 * sz, M1);
  }
 
  void set(ll k, const Monoid &x) {
    seg[k + sz] = x;
  }
 
  void build() {
    for(ll k = sz - 1; k > 0; k--) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }
 
  void update(ll k, const Monoid &x) {
    k += sz;
    seg[k] = x;
    while(k >>= 1) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }
 
  Monoid query(ll a, ll b) {
    Monoid L = M1, R = M1;
    for(a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
      if(a & 1) L = f(L, seg[a++]);
      if(b & 1) R = f(seg[--b], R);
    }
    return f(L, R);
  }
 
  Monoid operator[](const ll &k) const {
    return seg[k + sz];
  }
};

const ll MAX_V = 100000;

struct edge{ll from; ll to; ll cost;};
vector<edge> G1[MAX_V];
ll d1[MAX_V];

void add_edge1(ll from, ll to, ll cost) {
    edge e = {from, to, cost};
    G1[from].push_back(e);
}

void dijkstra1(ll s) {
    struct q_v{
        ll id;
        ll d;
        bool operator< (const q_v &t) const {
            return t.d < d;
        }
    };
    bool end[MAX_V] = {};
    for (ll i = 0; i < MAX_V; i++) d1[i] = (ll) 1e18;
    d1[s] = 0;
    priority_queue<q_v> q;
    q.push(q_v{s, 0});
    while (!q.empty()) {
        ll v = q.top().id;
        q.pop();
        if (end[v]) continue;
        end[v] = true;
        for (edge e : G1[v]) {
            if (!end[e.to]) {
                d1[e.to] = min(d1[e.to], d1[v] + e.cost);
                q.push(q_v{e.to, d1[e.to]});
            }
        }
    }
}

vector<edge> G2[MAX_V];
ll d2[MAX_V];

void add_edge2(ll from, ll to, ll cost) {
    edge e = {from, to, cost};
    G2[from].push_back(e);
}

void dijkstra2(ll s) {
    struct q_v{
        ll id;
        ll d;
        bool operator< (const q_v &t) const {
            return t.d < d;
        }
    };
    bool end[MAX_V] = {};
    for (ll i = 0; i < MAX_V; i++) d2[i] = (ll) 1e18;
    d2[s] = 0;
    priority_queue<q_v> q;
    q.push(q_v{s, 0});
    while (!q.empty()) {
        ll v = q.top().id;
        q.pop();
        if (end[v]) continue;
        end[v] = true;
        for (edge e : G2[v]) {
            if (!end[e.to]) {
                d2[e.to] = min(d2[e.to], d2[v] + e.cost);
                q.push(q_v{e.to, d2[e.to]});
            }
        }
    }
}

ll n, m, s, t;
string S;
ll ans = (ll)1e18;

ll u[101010], v[101010];
ll a[101010], b[101010];

void solve() {
    cin >> n >> m >> s >> t;
    rep(i,m) {
        cin >> u[i] >> v[i] >> a[i] >> b[i];
        u[i]--; v[i]--;
    }
    rep(i,m) {
        add_edge1(u[i], v[i], a[i]);
        add_edge1(v[i], u[i], a[i]);
    }
    dijkstra1(s-1);
    rep(i,m) {
        add_edge2(u[i], v[i], b[i]);
        add_edge2(v[i], u[i], b[i]);
    }
    dijkstra2(t-1);
    SegmentTree< ll > seg(n, [](ll a, ll b) { return min(a, b); }, (ll)1e18);
    rep(i,n) {
        seg.update(i, d1[i] + d2[i]);
    }
    rep(i,n) {
        cout << (ll)1e15 - seg.query(i,n) << endl;
    }
}

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
    solve();
    return 0;
}


Measured memory_bytes: 29280