#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <iomanip>
using ll = long long;
using uint = unsigned int;
using graph = std::vector<std::vector<ll>>;
using wGraph = std::vector<std::vector<std::pair<ll,ll>>>;
#define rep(i,n) for (int i=0; i < int(n); i++)

using namespace std;
ll MOD7 = 1000000007;
ll MOD9 = 1000000009;
vector<ll> InputVec(ll N){
    vector<ll> A(N);
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
    }
    return A;
}
void OutputVec(vector<ll> A){
    for (int i = 0; i < A.size(); ++i) {
        cout << A[i] << ",";
    }
    cout << endl;
}
vector<vector<ll>> InputVec2d(ll H,ll W){
    vector<vector<ll>> A(H);
    for (int yi = 0; yi < H; ++yi) {
        A[yi] = vector<ll>(W);
    }
    for (int yi = 0; yi < H; ++yi) {
        for (int xi = 0; xi < W; ++xi) {
            cin >> A[yi][xi];
        }
    }
    return A;
}
vector<vector<char>> InputVec2dStr(ll H,ll W){
    vector<vector<char>> A(H);
    for (int yi = 0; yi < H; ++yi) {
        A[yi] = vector<char>(W);
    }
    for (int yi = 0; yi < H; ++yi) {
        string S;
        cin >> S;
        for (int xi = 0; xi < W; ++xi) {
            A[yi][xi] = S[xi];
        }
    }
    return A;
}
void OutputVec2d(vector<vector<ll>> A){
    for (int yi = 0; yi < A.size(); ++yi) {
        for (int xi = 0; xi < A[yi].size(); ++xi) {
            cout << A[yi][xi] << ",";
        }
        cout << endl;
    }
}
graph InputGraph(ll N,ll M){
    graph G(N);
    for (int i = 0; i < M; ++i) {
        ll a,b;
        cin >> a >> b;
        a--;b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    return G;
}
graph InputDGraph(ll N,ll M){
    graph G(N);
    for (int i = 0; i < M; ++i) {
        ll a,b;
        cin >> a >> b;
        a--;b--;
        G[a].push_back(b);
    }
    return G;
}
wGraph InputWGraph(ll N,ll M){
    wGraph G(N);
    for (int i = 0; i < M; ++i) {
        ll a,b,c;
        cin >> a >> b >> c;
        a--;b--;
        G[a].push_back(make_pair(b,c));
        G[b].push_back(make_pair(a,c));
    }
    return G;
}
wGraph InputDWGraph(ll N, ll M){
    wGraph G(N);
    for (int i = 0; i < N; ++i) {
        ll a,b,c;
        cin >> a >> b >> c;
        a--;b--;
        G[a].push_back(make_pair(b,c));
    }
    return G;
}
void OutputGraph(graph G){
    for (int i = 0; i < G.size(); ++i) {
        cout << i << ":";
        for (int j = 0; j < G[i].size(); ++j) {
            cout << G[i][j]<< ",";
        }
        cout << endl;
    }
}
void OutputAnswerBool(bool b,bool isUpperCase = false){
    if(b){
        if(isUpperCase){
            cout << "YES" << endl;
        }else{
            cout << "Yes" << endl;
        }
    }else{
        if(isUpperCase){
            cout << "NO" << endl;
        }else{
            cout << "No" << endl;
        }
    }
}

int main() {
    ll N,M,s,t;
    cin >> N >> M >> s >> t;
    wGraph G1(N);
    wGraph G2(N);
    for (int i = 0; i < M; ++i) {
        ll u,v,a,b;
        cin >> u >> v >> a >> b;
        u--;v--;
        G1[u].push_back(make_pair(v,a));
        G1[v].push_back(make_pair(u,a));
        G2[u].push_back(make_pair(v,b));
        G2[v].push_back(make_pair(u,b));
    }
    priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>> q; //Cost,Vert
    q.push(make_pair(0,s-1));
    vector<ll> cost(N);
    vector<bool> seen(N);
    for (int i = 0; i < N; ++i) {
        cost[i] = (1ll << 50);
        seen[i] = false;
    }

    cost[s-1] = 0;
    while(!q.empty()){
        auto current = q.top();q.pop();
        ll currentCost = current.first;
        ll currentId = current.second;
        if(cost[currentId] < currentCost){
            continue;
        }
        seen[currentId] = true;
        for (int i = 0; i < G1[currentId].size(); ++i) {
            auto next = G1[currentId][i];
            ll nextId = next.first;
            ll edgeCost = next.second;
            if(seen[nextId]){
                continue;
            }
            ll nextCost = cost[currentId] + edgeCost;
            if(nextCost < cost[nextId]){
                cost[nextId] = nextCost;
                q.push(make_pair(nextCost,nextId));
            }
        }
    }
    //OutputVec(cost);
    auto q2 = priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>>(); //Cost,Vert
    q2.push(make_pair(0,t-1));
    vector<ll> cost2(N);
    for (int i = 0; i < N; ++i) {
        cost2[i] = (1ll << 50);
        seen[i] = false;
    }

    cost2[t-1] = 0;
    while(!q2.empty()){
        auto current = q2.top();q2.pop();
        ll currentCost = current.first;
        ll currentId = current.second;
        if(cost2[currentId] < currentCost){
            continue;
        }
        seen[currentId] = true;
        for (int i = 0; i < G2[currentId].size(); ++i) {
            auto next = G2[currentId][i];
            ll nextId = next.first;
            ll edgeCost = next.second;
            if(seen[nextId]){
                continue;
            }
            ll nextCost = cost2[currentId] + edgeCost;
            if(nextCost < cost2[nextId]){
                cost2[nextId] = nextCost;
                q2.push(make_pair(nextCost,nextId));
            }
        }
    }
    //OutputVec(cost2);
    vector<ll> res(N);
    ll F = 1000000000000000;
    res[N-1] = F - cost[N-1] - cost2[N-1];
    for (int i = N-2; i >= 0; --i) {
        ll tmp = F - cost[i] - cost2[i];
        res[i] = max(res[i+1],tmp);
    }
    for (int j = 0; j < N; ++j) {
        cout << res[j] << endl;
    }


}


Measured memory_bytes: 20216