# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
# include <cstdlib>
# include <tuple>
# include <array>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2147483647;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr double HDINF = 50000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define RALL(qpqpq)           (qpqpq).rbegin(),(qpqpq).rend()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define RFOR(i,tptpt,ypypy)  for(LL i=(tptpt);i>=(ypypy);i--)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

LL n, m, s, t;
struct edge { LL to, cost; };

typedef pair<LL, LL> P;

LL d_y[100100],d_s[100100]; //距離
vector<edge> vec_y[100100],vec_s[100100];

void dijkstra_y() {
	for (int i = 0; i < 100100; i++)d_y[i] = HLINF;
	priority_queue<P, std::vector<P>, std::greater<P>> pq;
	d_y[s] = 0;
	pq.push(make_pair(d_y[s], s));//cost,to
	while (!pq.empty()) {
		P p = pq.top();
		pq.pop();
		int i = p.second;
		if (d_y[i] < p.first)continue;
		for (int k = 0; k < vec_y[i].size(); k++) {
			edge e = vec_y[i][k];
			if (d_y[e.to] <= d_y[i] + e.cost)continue;
			d_y[e.to] = d_y[i] + e.cost;
			pq.push(make_pair(d_y[e.to], e.to));
		}
	}
}
void dijkstra_s() {
	for (int i = 0; i < 100100; i++)d_s[i] = HLINF;
	priority_queue<P, std::vector<P>, std::greater<P>> pq;
	d_s[t] = 0;
	pq.push(make_pair(d_s[t], t));//cost,to
	while (!pq.empty()) {
		P p = pq.top();
		pq.pop();
		int i = p.second;
		if (d_s[i] < p.first)continue;
		for (int k = 0; k < vec_s[i].size(); k++) {
			edge e = vec_s[i][k];
			if (d_s[e.to] <= d_s[i] + e.cost)continue;
			d_s[e.to] = d_s[i] + e.cost;
			pq.push(make_pair(d_s[e.to], e.to));
		}
	}
}

int main() {
	cin >> n >> m >> s >> t;
	REP(i, m) {
		LL u, v, a, b;
		cin >> u >> v >> a >> b;
		vec_y[u].emplace_back(edge{ v, a });
		vec_y[v].emplace_back(edge{ u, a });
		vec_s[u].emplace_back(edge{ v, b });
		vec_s[v].emplace_back(edge{ u, b });
	}
	dijkstra_y();
	dijkstra_s();
	vector<pair<LL, int>> v;
	for (int i = 1; i <= n;i++) {
		v.emplace_back(make_pair(d_y[i] + d_s[i], i));
	}
	sort(ALL(v));
	int pos = 0;
	REP(i,n) {
		while (v[pos].second <= i)pos++;
		LL ans = pow(10, 15) - v[pos].first;
		cout << ans << endl;
	}
	//system("pause");
}

Measured memory_bytes: 19900