#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#include <random>
#include <unordered_map>
#include <unordered_set>

using namespace std;

//呪文
#define DUMPOUT cerr
#define dump(...) DUMPOUT<<"  ";DUMPOUT<<#__VA_ARGS__<<" :["<<__LINE__<<":"<<__FUNCTION__<<"]"<<endl;DUMPOUT<<"    ";dump_func(__VA_ARGS__)

typedef unsigned uint; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; typedef pair<string, string> pss;
template <typename _KTy, typename _Ty> ostream& operator << (ostream& ostr, const pair<_KTy, _Ty>& m) { ostr << "{" << m.first << ", " << m.second << "}"; return ostr; }
template <typename _KTy, typename _Ty> ostream& operator << (ostream& ostr, const map<_KTy, _Ty>& m) { if (m.empty()) { ostr << "{ }"; return ostr; } ostr << "{" << *m.begin(); for (auto itr = ++m.begin(); itr != m.end(); itr++) { ostr << ", " << *itr; } ostr << "}"; return ostr; }
template <typename _KTy, typename _Ty> ostream& operator << (ostream& ostr, const unordered_map<_KTy, _Ty>& m) { if (m.empty()) { ostr << "{ }"; return ostr; } ostr << "{" << *m.begin(); for (auto itr = ++m.begin(); itr != m.end(); itr++) { ostr << ", " << *itr; } ostr << "}"; return ostr; }
template <typename _Ty> ostream& operator << (ostream& ostr, const vector<_Ty>& v) { if (v.empty()) { ostr << "{ }"; return ostr; } ostr << "{" << v.front(); for (auto itr = ++v.begin(); itr != v.end(); itr++) { ostr << ", " << *itr; }	ostr << "}"; return ostr; }
template <typename _Ty> ostream& operator << (ostream& ostr, const set<_Ty>& s) { if (s.empty()) { ostr << "{ }"; return ostr; } ostr << "{" << *(s.begin()); for (auto itr = ++s.begin(); itr != s.end(); itr++) { ostr << ", " << *itr; }	ostr << "}"; return ostr; }
template <typename _Ty> ostream& operator << (ostream& ostr, const unordered_set<_Ty>& s) { if (s.empty()) { ostr << "{ }"; return ostr; } ostr << "{" << *(s.begin()); for (auto itr = ++s.begin(); itr != s.end(); itr++) { ostr << ", " << *itr; }	ostr << "}"; return ostr; }
template <typename _Ty> ostream& operator << (ostream& ostr, const stack<_Ty>& s) { if (s.empty()) { ostr << "{ }"; return ostr; } stack<_Ty> t(s); ostr << "{" << t.top(); t.pop(); while (!t.empty()) { ostr << ", " << t.top(); t.pop(); } ostr << "}";	return ostr; }
template <typename _Ty> ostream& operator << (ostream& ostr, const list<_Ty>& l) { if (l.empty()) { ostr << "{ }"; return ostr; } ostr << "{" << l.front(); for (auto itr = ++l.begin(); itr != l.end(); ++itr) { ostr << ", " << *itr; } ostr << "}"; return ostr; }
template <typename _KTy, typename _Ty> istream& operator >> (istream& istr, pair<_KTy, _Ty>& m) { istr >> m.first >> m.second; return istr; }
template <typename _Ty> istream& operator >> (istream& istr, vector<_Ty>& v) { for (size_t i = 0; i < v.size(); i++) istr >> v[i]; return istr; }
namespace aux { // print tuple
	template<typename Ty, unsigned N, unsigned L> struct tp { static void print(ostream& os, const Ty& v) { os << get<N>(v) << ", "; tp<Ty, N + 1, L>::print(os, v); } };
	template<typename Ty, unsigned N> struct tp<Ty, N, N> { static void print(ostream& os, const Ty& value) { os << get<N>(value); } };
}
template<typename... Tys> ostream& operator<<(ostream& os, const tuple<Tys...>& t) { os << "{"; aux::tp<tuple<Tys...>, 0, sizeof...(Tys)-1>::print(os, t); os << "}"; return os; }

template<typename A, size_t N, typename T> inline void Fill(A(&array)[N], const T &val) { std::fill((T*)array, (T*)(array + N), val); }

void dump_func() { DUMPOUT << endl; }
template <class Head, class... Tail> void dump_func(Head&& head, Tail&&... tail) { DUMPOUT << head; if (sizeof...(Tail) == 0) { DUMPOUT << " "; } else { DUMPOUT << ", "; } dump_func(std::move(tail)...); }

#define PI 3.14159265358979323846
#define EPS 1e-8
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define fake false



class edge {
public:
	int from, to, cost;

	edge() : from(0), to(0), cost(0) {}
	edge(int from, int to) : from(from), to(to), cost(1) {}
	edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};

class Dijkstra {

	const ll INF;

	// d[i] : 始点 s から頂点 i への最短距離
	// d[i] = min(d[j] + (j から i への辺のコスト) | e = (j, i) in E)
	vector<ll> d;
	vector<ll> prev;

public:

	typedef pair<ll, ll> pll;

	// Dijkstra 法 O(|E|log|V|) (負の辺がない場合)
	// G : 隣接リスト, V : 頂点数, s : スタート地点
	// edge の from は使わないので -1 とか入れとく
	Dijkstra(const vector<vector<edge> >& G, ll V, ll s)
		: INF(1LL << 60), d(V, INF), prev(V, -1)
	{
		// pll(最短距離, 頂点の番号)
		priority_queue<pll, vector<pll>, greater<pll> > pq;

		d[s] = 0;
		pq.push(pll(0, s));

		while (!pq.empty()) {
			pll p = pq.top(); pq.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;
					prev[e.to] = v;
					pq.push(pii(d[e.to], e.to));
				}
			}
		}
	}

	vector<ll> shortest_path_cost() { return d; }
	ll shortest_path_cost(ll v) { return d[v]; }
};

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

	ll n, m, s, t;
	cin >> n >> m >> s >> t;
	s--; t--;
	//vector<ll> u(m), v(m), a(m), b(m);
	vector<vector<edge>> e_st(n), e_ts(n);
	for (int i = 0; i < m; i++) {
		//cin >> u[i] >> v[i] >> a[i] >> b[i];
		ll u, v, a, b;
		cin >> u >> v >> a >> b;
		u--; v--;
		e_st[u].push_back(edge(-1, v, a));
		e_st[v].push_back(edge(-1, u, a));
		e_ts[u].push_back(edge(-1, v, b));
		e_ts[v].push_back(edge(-1, u, b));
	}
	
	vector<ll> st_mincost = Dijkstra(e_st, n, s).shortest_path_cost();
	vector<ll> ts_mincost = Dijkstra(e_ts, n, t).shortest_path_cost();

	//dump(st_mincost);
	//dump(ts_mincost);

	vector<ll> via_cost(n);
	ll money = 1000000000000000LL;
	for (int i = 0; i < n; i++) {
		via_cost[i] = st_mincost[i] + ts_mincost[i];
	}
	//dump(via_cost);

	vector<ll> ans(n);
	{
		ll current_mincost = INT64_MAX;
		for (int i = n - 1; i >= 0; i--) {
			current_mincost = min(current_mincost, via_cost[i]);
			ans[i] = current_mincost;
		}
	}

	for (int i = 0; i < n; i++)
		cout << money - ans[i] << endl;

	return 0;
}

Measured memory_bytes: 18072