/*
　　　∫ ∫ ∫
　　　ノヽ
　　（＿　 ）
　（＿　　　 ）
（＿＿＿＿＿＿ ）
　ヽ(´･ω･)ﾉ　
　　 |　 /
　　 UU
*/
#pragma region macro
#include <bits/stdc++.h>
typedef long long int64;
using namespace std;
using P = pair<int64, int64>;
typedef vector<int> vi;
const int MOD = (int)1e9 + 7;
const int64 INF = 1LL << 62;
const int inf = 1<<30;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i,s,n) for (int i = s; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end() //コンテナじゃないと使えない!!
#define debug(x) cerr << #x << ": " << x << "\n";
#define mp make_pair
#define bn '\n'
template <typename T>
ostream& operator<<(ostream& os, vector<T> &V){
    int N = V.size();
    REP(i,N){
        os << V[i];
        if (i!=N-1) os << " ";
    }
    os << "\n";
    return os;
}
template <typename T,typename S>
ostream& operator<<(ostream& os, pair<T,S> const&P){
    os << "(";
    os << P.first;
    os << " , ";
    os << P.second;
    os << ")";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T> &S){
    auto it=S.begin();
    while(it!=S.end()){
        os << *it;
        os << " ";
        it++;
    }
    os << "\n";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, deque<T> &q){
    for(auto it=q.begin();it<q.end();it++){
        os<<*it;
        os<<" ";
    }
     os<<endl;
    return os;
}
vector<pair<int,int>> dxdy = {mp(0,1),mp(1,0),mp(-1,0),mp(0,-1)};
#pragma endregion
//fixed<<setprecision(10)<<ans<<endl;

vector<int64> dijkstra(vector<vector<pair<int,int>>> const& edge, int start){
    int N = edge.size();
    vector<int64> dist(N,INF);
    priority_queue<pair<int64,int64>,vector<pair<int64,int64>>, greater<pair<int64,int64>> > q;
    q.push(mp(0, start));
    vector<bool> visited(N,false);
    
    int64 from,d;
    int64 to,cost;
    while(!q.empty()){
        tie(d,from) = q.top(); q.pop();
        if (visited[from]) continue;
        visited[from] = true;
        dist[from] = d;
        for(auto e:edge[from]){
            tie(to,cost) = e;
            if (visited[to]) continue;
            q.push(mp(d+cost, to));
        }
    }

    return dist;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N,M,s,t;
    cin >> N >> M >> s >> t;
    s--;t--;
    vector<vector<pair<int,int>>> edge_yen(N);
    vector<vector<pair<int,int>>> edge_snuuk(N);
    int u,v,a,b;
    REP(i,M){
        cin >> u >> v >> a >> b;
        u--;v--;
        edge_yen[u].emplace_back(v,a);
        edge_yen[v].emplace_back(u,a);
        edge_snuuk[u].emplace_back(v,b);
        edge_snuuk[v].emplace_back(u,b);
    }

    auto dist_yen_from_s = dijkstra(edge_yen, s);
    auto dist_snuuk_from_t = dijkstra(edge_snuuk, t);

    vector<pair<int64,int>> cost_list;
    REP(exchange_node, N){
        int64 cost = dist_yen_from_s[exchange_node] + dist_snuuk_from_t[exchange_node];
        cost_list.emplace_back(cost, exchange_node);
    }

    sort(ALL(cost_list));

    int idx = 0;
    int64 money = 1e15;
    REP(year,N){
        while(cost_list[idx].second<year) idx++;
        cout << money-cost_list[idx].first << bn;
    }
}

Measured memory_bytes: 16996