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

const long long inf = 100000000000000037;
const long long yens = 1000000000000000;
const int maxn = 100005;

int n, m, s, t, u, v, w, a, b;
vector < pair < int, int > > ga[maxn];
vector < pair < int, int > > gb[maxn];
long long da[maxn], db[maxn], ans[maxn];
set < pair < long long, int > > dset;

signed main () {
	scanf("%d %d %d %d", &n, &m, &s, &t);
	for (int i = 0; i < m; ++i) {
		scanf("%d %d %d %d", &u, &v, &a, &b);
		ga[u].push_back(make_pair(v, a));
		ga[v].push_back(make_pair(u, a));
		gb[u].push_back(make_pair(v, b));
		gb[v].push_back(make_pair(u, b));
	}
	for (int i = 1; i <= n; ++i)
		da[i] = db[i] = inf;
	da[s] = 0LL;
	dset.insert(make_pair(da[s], s));
	while (!dset.empty()) {
		u = dset.begin() -> second;
		dset.erase(dset.begin());
		for (auto pr: ga[u]) {
			v = pr.first, w = pr.second;
			if (da[v] > da[u] + w) {
				dset.erase(make_pair(da[v], v));
				da[v] = da[u] + w;
				dset.insert(make_pair(da[v], v));
			}
		}
	}
	db[t] = 0LL;
	dset.insert(make_pair(db[t], t));
	while (!dset.empty()) {
		u = dset.begin() -> second;
		dset.erase(dset.begin());
		for (auto pr: gb[u]) {
			v = pr.first, w = pr.second;
			if (db[v] > db[u] + w) {
				dset.erase(make_pair(db[v], v));
				db[v] = db[u] + w;
				dset.insert(make_pair(db[v], v));
			}
		}
	}
	ans[n + 1] = inf;
	for (int i = n; i; --i) 
		ans[i] = min(ans[i + 1], da[i] + db[i]);
	for (int i = 1; i <= n; ++i)
		printf("%lld\n", yens - ans[i]);
}
