#include <iostream>
#include <algorithm>
#include <array>
#include <bitset>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include <tuple>
#include <queue>
#include <vector>
#include <cmath>
#include <random>
#include <math.h>
#include <random>



#define REP(i, n) for(int (i) = 0; (i) < (n); ++(i))
#define rREP(i, n) for(int (i) = (n) - 1; (i) >= 0; --(i))
#define ALL(TheArray) TheArray.begin(), TheArray.end()

using lli = long long int;
using pii = std::pair<int, int>;

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

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


// Dijkstra 法 を行うクラス : updated : doubleも可能
template <class DistanceType = int, class AnsType = long long int>
class Dijkstra{
private:
    // 無限大 の距離
    const long long int infinity_cost = 9e18 + 1;
    const int V; // 枝の数, 頂点数
    // (指し示す頂点, コスト)
    using edge = std::pair<int, DistanceType>;
    using edgeSet = std::vector<edge>; // 1つの頂点からでる枝の集合
    std::vector<edgeSet> Edges; // 枝全体
    std::vector<AnsType> Distances; // 距離を表す
    std::vector<bool> hasVisited;
public:
    // コンストラクタ
    Dijkstra(int edgeSize): V(edgeSize){
        Edges.resize(edgeSize, edgeSet(0)); hasVisited.resize(edgeSize);
        Distances.resize(edgeSize, infinity_cost);
    }
    Dijkstra(int edgeSize, std::vector<edgeSet> &A): V(edgeSize){
        Edges = A; hasVisited.resize(edgeSize);
        Distances.resize(edgeSize, infinity_cost);
    }
    // デコンストラクタ
    ~Dijkstra(void){}
    // 頂点 u -> v へ 重み cost を追加
    void add(int u, int v, DistanceType cost){
        Edges[u].emplace_back(std::pair<int, DistanceType>(v, cost));
    }
    // 頂点 vertex 中心の計算を行う
    using Info__Type_ = std::pair<AnsType, int>;
    void computeAround(int vertex){
        std::fill(Distances.begin(), Distances.end(), infinity_cost);
        std::fill(hasVisited.begin(), hasVisited.end(), false);
        std::priority_queue<Info__Type_, std::vector<Info__Type_>,
            std::greater<Info__Type_>> undoneEdge;
        undoneEdge.push(edge(0, vertex));
        int vtx; AnsType dist;
        while(not undoneEdge.empty()){
            std::tie(dist, vtx) = undoneEdge.top(); undoneEdge.pop();
            
            if(hasVisited[vtx]) continue;
            hasVisited[vtx] = true; Distances[vtx] = dist;
            for(edge element : Edges[vtx]){
                AnsType nextDistance = dist + element.second;
                if(nextDistance < Distances[element.first])
                        undoneEdge.push(Info__Type_(nextDistance, element.first));
            }
        }
    }
    AnsType distance(int vertex){
        return Distances.at(vertex);
    }
    void debugShow(void){
        for(int i = 0; i < V; ++i){
            printf("距離[%d] : ", i);
            if(Distances[i] == infinity_cost) std::cout << "INF" << '\n';
            else std::cout << Distances[i] << '\n';
        }
    }
};

constexpr lli MONEY = 1e15;
std::vector<lli> ans;


int main(void){
    int n, m, s, t; scanf("%d%d%d%d", &n, &m, &s, &t); s--; t--;
    Dijkstra<> Yen(n), Snuuk(n);
    REP(i, m){
        int a, b, u, v; scanf("%d%d%d%d", &a, &b, &u, &v); a--; b--;
        Yen.add(a, b, u);   Yen.add(b, a, u);
        Snuuk.add(a, b, v); Snuuk.add(b, a, v);
    }

    Yen.computeAround(s); Snuuk.computeAround(t);

    ans.resize(n+1); ans[n] = 0;

    rREP(i, n){
        lli cost = Yen.distance(i) + Snuuk.distance(i);
        ans[i] = std::max(ans[i+1], MONEY - cost);
    }
    REP(i, n) printf("%lld\n", ans[i]);


    return 0;
}


Measured memory_bytes: 16116