#include <bits/stdc++.h>
using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef tuple<int,int,int> tpl;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define LB(a,x) lower_bound((a).begin(), (a).end(), x) - (a).begin()
#define UB(a,x) upper_bound((a).begin(), (a).end(), x) - (a).begin()

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

#define en "\n"

const double EPS = 1e-9;
const double PI  = acos(-1.0);
const int INT_INF = 2147483647;
const long long LL_INF = 1LL<<60;
const long long MOD = 1000000007; // 998244353

#define CLR(a) memset((a), 0, sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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; }

struct Node{
    int id;
    ll v;
    bool done = false;
    Node(int id, ll v=1e17): id(id), v(v) {}
    Node(): id(0), v(1e17) {}
};

bool operator>(Node a, Node  b){
    return a.v > b.v;
}

struct Edge{
    int from, to, id;
    ll cost;
    Edge(int from, int to, ll cost=1, int id=-1): from(from), to(to), cost(cost), id(id) {}
};

struct Graph{
    int N;
    vector<vector<Edge>> adj;
    vector<Node> node;

    Graph(int N): N(N) {
        adj.assign(N, vector<Edge>());
        node.assign(N, Node());
        for(int i=0; i<N; ++i) node[i].id = i;
    }

    Graph() {}

    void add_edge(int i, int j, ll cost=1, int id=-1){
        Edge e(i, j, cost, id);
        adj[i].emplace_back(e);
    }

    vector<Edge> get_adj(Node node){
        return adj[node.id];
    }

    void assign(int n){
        N = n;
        adj.assign(N, vector<Edge>());
        node.assign(N, Node());
        for(int i=0; i<N; ++i) node[i].id = i;
    }

    void reset(){
        for(int i=0; i<N; ++i){
            node[i].done = false;
            node[i].v = 1e17;
        }
    }
};

int main(void){
    ll n,m,s,t; cin >> n >> m >> s >> t; s--; t--;
    Graph G1(n), G2(n);
    REP(i,m){
        ll u,v,a,b; cin >> u >> v >> a >> b; u--; v--;
        G1.add_edge(u,v,a);
        G1.add_edge(v,u,a);
        G2.add_edge(u,v,b);
        G2.add_edge(v,u,b);
    }

    vector<pair<ll,ll>> d(n);

    priority_queue<Node,vector<Node>,greater<Node>> q1;
    q1.push(Node(s,0));
    while(q1.size()){
        Node n = q1.top(); q1.pop();
        if(G1.node[n.id].done) continue;
        G1.node[n.id].done = true;
        if(chmin(G1.node[n.id].v, n.v)){
            for(Edge e : G1.get_adj(n)) q1.push(Node(e.to, n.v+e.cost));
        }
    }

    priority_queue<Node,vector<Node>,greater<Node>> q2;
    q2.push(Node(t,0));
    while(q2.size()){
        Node n = q2.top(); q2.pop();
        if(G2.node[n.id].done) continue;
        G2.node[n.id].done = true;
        if(chmin(G2.node[n.id].v, n.v)){
            for(Edge e : G2.get_adj(n)) q2.push(Node(e.to, n.v+e.cost));
        }
    }

    priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>> q;
    REP(i,n){
        d[i].first = G1.node[i].v + G2.node[i].v;
        d[i].second = i;
        q.push(d[i]);
    }

    REP(i,n){
        while(q.size() && q.top().second < i) q.pop();
        ll ans = 1e15 - q.top().first;
        cout << ans << en;
    }
    return 0;
}

Measured memory_bytes: 32240