#define LOCAL
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define memr(dp, val) memset(dp, val, sizeof(dp))
using namespace std;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> inline bool int_ceil(T a, T b) { T res = a / b; if(a % b != 0) res++; return res; }
template<typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
string to_string(string s) { return '"' + s + '"'; }
string to_string(bool b) { return b ? "true" : "false"; }
template <size_t N> string to_string(bitset<N> bs) {
  string res;
  for (size_t i = 0; i < N; ++i) res += '0' + bs[i];
  return res;
}
string to_string(vector<bool> v) {
  string res = "{";
  for (bool e : v) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p);
template <class C> string to_string(C c) {
  string res = "{";
  for (auto e : c) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug() { cerr << '\n'; }
template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << '\t' << to_string(head), debug(tail...);
}
#ifdef LOCAL
#define print(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define print(...)
#endif


struct edge {
  ll to, cost;
};
typedef pair<ll, ll> P;

ll V;
vector<edge> G[MAX]; // 頂点iのedgeを格納
vector<edge> G2[MAX]; // 頂点iのedgeを格納
ll d[MAX];
ll d2[MAX];

void dijkstra(ll s){
    // greater<P>を指定することでfirstが小さい順に取り出せるようにする
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d, d+V, LLINF);
    d[s] = 0;
    que.push(P(0,s));

    while(!que.empty()){
        P p = que.top(); que.pop();
        ll v = p.second;
        if (d[v] < p.first) continue;
        for(ll i=0; i<G[v].size(); i++){
            edge e = G[v][i];
            if(d[e.to] > d[v] + e.cost){
                // 更新
                d[e.to] = d[v] + e.cost;
                que.push(P(d[e.to], e.to));
            }
        }
    }
}

void dijkstra2(ll s){
    // greater<P>を指定することでfirstが小さい順に取り出せるようにする
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d2, d2+V, LLINF);
    d2[s] = 0;
    que.push(P(0,s));

    while(!que.empty()){
        P p = que.top(); que.pop();
        ll v = p.second;
        if (d2[v] < p.first) continue;
        for(ll i=0; i<G2[v].size(); i++){
            edge e = G2[v][i];
            if(d2[e.to] > d2[v] + e.cost){
                // 更新
                d2[e.to] = d2[v] + e.cost;
                que.push(P(d2[e.to], e.to));
            }
        }
    }
}

int main(int argc, const char * argv[]) {
	std::cout << std::fixed << std::setprecision(15);

	int n, m, s, t; cin >> n >> m >> s >> t;
	V = n;
	s--; t--;
	rep(i, m){
		ll u, v, a, b; cin >> u >> v >> a >> b;
		u--; v--;
		G[u].push_back({v, a});
		G[v].push_back({u, a});
		G2[u].push_back({v, b});
		G2[v].push_back({u, b});
	}
	dijkstra(s);
	dijkstra2(t);
	ll res = LLINF;
	vector<ll> ans;
	rrep(i, n){
		chmin(res, d[i] + d2[i]);
		ans.push_back(res);
	}

	rrep(i, ans.size()){
		cout << (ll)(1e15 - ans[i]) << endl;
	}


	return 0;
}


Measured memory_bytes: 21392