#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
#include <sys/time.h>
#include <sys/resource.h>
#include <thread>
#include <chrono>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<P> vp;
typedef vector<PL> vpl;
typedef vector<vector<P>> vvp;
typedef vector<vector<PL>> vvpl;
const int INF = 1001001001;
const ll LINF = 1e18;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, n) for(ll i = n; i >= 0; i--)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back

template <typename T>
T gcd(T a, T b) {
    return (a == 0) ? b : gcd(b%a, a);
}
template <typename T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

bool p_comp_fs(const PL p1, const PL p2){ return p1.first < p2.first;};
bool p_comp_fg(const PL p1, const PL p2){ return p1.first > p2.first;};
bool p_comp_ss(const PL p1, const PL p2){ return p1.second < p2.second;};
bool p_comp_sg(const PL p1, const PL p2){ return p1.second > p2.second;};
bool pcomp(const PL p1, const PL p2){ return p1.ss*p2.ff < p2.ss*p1.ff;};
template <typename T>
vector<T> uniquen(vector<T> vec){
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}

template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }


int main(){
    const ll size = 100100;
    vpl Ga[size], Gb[size];
    ll N, M; cin >> N >> M; ll s, t; cin >> s >> t; s--; t--;
    rep(_, M){
        ll u, v, a, b; cin >> u >> v >> a >> b; u--; v--;
        Ga[u].pb({v, a}); Ga[v].pb({u, a});
        Gb[u].pb({v, b}); Gb[v].pb({u, b});
    }
    
    vl da(N, LINF); da[s] = 0;
    priority_queue<PL, vpl, greater<PL>> pq;
    pq.push({0, s});
    while (!pq.empty()) {
        ll now = pq.top().ss, now_c = pq.top().ff; pq.pop();
        if(da[now] < now_c) continue;
        for(PL& c : Ga[now]){
            if(da[c.ff] > now_c + c.ss){
                da[c.ff] = now_c + c.ss;
                pq.push({da[c.ff], c.ff});
            }
        }
    }
    
    vl db(N, LINF); db[t] = 0;
    pq = priority_queue<PL, vpl, greater<PL>>();
    pq.push({0, t});
    while (!pq.empty()) {
        ll now = pq.top().ss, now_c = pq.top().ff; pq.pop();
        if(db[now] < now_c) continue;
        for(auto& c : Gb[now]){
            if(db[c.ff] > now_c + c.ss){
                db[c.ff] = now_c + c.ss;
                pq.push({db[c.ff], c.ff});
            }
        }
    }
    
    ll have = 1e15;
    ll mn = LINF; vl ans;
    for(ll i = N-1; i >= 0; i--){
        chmin(mn, da[i] + db[i]);
        ans.pb(have - mn);
    }
    reverse(ans.begin(), ans.end());
    for(auto a : ans) cout << a << endstr;
    return 0;
}


Measured memory_bytes: 20540