#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;
typedef long double ld;
const ll INF = 1e16;

struct Edge{
    int to;
    ll cost;
    Edge(int to,ll cost): to(to), cost(cost){}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

bool operator < (const Edge &e, const Edge &f){
    return e.cost > f.cost;
}

vector<ll> dijkstra(const Graph &g, int s){
    vector<ll> d(g.size(),INF);
    d[s] = 0;
    priority_queue<P, vector<P>, greater<P>> que;
    que.push(P(0,s)); // P(dis, pos)
    while(!que.empty()){
        ll dist = que.top().first;
        int v = que.top().second;
        que.pop();
        if(d[v]<dist) continue;
        for(const auto &e: g[v]){
            if(d[e.to]<=d[v]+e.cost) continue;
            d[e.to] = d[v] + e.cost;
            que.push(P(d[e.to], e.to));
        }
    }
    return d;
}

// RMQ
struct RMQ {
	using type = ll;
	static type id() { return 1e16; }
	static type op(const type& l, const type & r) { return min(l, r); }
};

struct RSQ {
	using type = int;
	static type id() { return 0; }
	static type op(const type& l, const type & r) { return l + r; }
};

struct RMSQ {
	struct type {
		ll left, right, all, sum;
		type() : left(-INF), right(-INF), all(-INF), sum(0) {}
		type(ll val) : left(val), right(val), all(val), sum(val) {}
		type(ll l, ll r, ll a, ll s) : left(l), right(r), all(a), sum(s) {}
	};
	static type id() { return type(); }
	static type op(const type& l, const type & r) {
		return type(max(l.left, l.sum + r.left), max(r.right, r.sum + l.right), max({ l.all, r.all, l.right + r.left }), l.sum + r.sum);
	}
};

// segment tree
template <typename M>
class segment_tree {
	using T = typename M::type;
	const int n;
	vector<T> data;
	int size(int n) {
		int res;
		for (res = 1; res < n; res <<= 1);
		return res;
	}
public:
	segment_tree(int n_) : n(size(n_)), data(n * 2, M::id()) {}
	segment_tree(int n_, T val) : n(size(n_)), data(n * 2, val) {}
	void init(const vector<T>& data_) {
		for (int i = 0; i < (int)data_.size(); i++)
			data[i + n] = data_[i];
		for (int i = n - 1; i >= 0; i--)
			data[i] = M::op(data[i * 2], data[i * 2 + 1]);
	}
	void update(int p, T val) {
		p += n;
		data[p] = val;
		while (p >>= 1) data[p] = M::op(data[p * 2], data[p * 2 + 1]);
	}
	void add(int p, T val) {
		p += n;
		data[p] += val;
		while (p >>= 1) data[p] = M::op(data[p * 2], data[p * 2 + 1]);
	}
	T find(int l, int r) {
		l += n; r += n + 1;
		T res1 = M::id(), res2 = M::id();
		while (l < r) {
			if (l & 1) res1 = M::op(res1, data[l++]);
			if (r & 1) res2 = M::op(data[--r], res2);
			l >>= 1; r >>= 1;
		}
		return M::op(res1, res2);
	}
};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n,m,st,gt;cin>>n>>m>>st>>gt;
    st--;gt--;
    ll money=1e15;
    Graph ja(n),sn(n);
    for(int i=0;i<m;i++){
        int u,v; ll a,b;
        cin>>u>>v>>a>>b;
        u--; v--;
        ja[u].push_back(Edge(v,a));
        ja[v].push_back(Edge(u,a));

        sn[u].push_back(Edge(v,b));
        sn[v].push_back(Edge(u,b));
    }
    vector<ll> jdis=dijkstra(ja,st),sdis=dijkstra(sn,gt);
    segment_tree<RMQ> seg(111111);
    for(int i=0;i<n;i++){
        seg.update(i,jdis[i] + sdis[i]);
    }
    for(int i=0;i<n;i++){
        ll res=1e16;
        res=seg.find(i,100001);
        cout<<money-res<<endl;
    }
}

Measured memory_bytes: 20348