import std.algorithm;
import std.container;
import std.range;
import std.stdio;
import std.typecons;

void main ()
{
	int n, m, s, t;
	while (readf (" %s %s %s %s", &n, &m, &s, &t) > 0)
	{
		s -= 1;
		t -= 1;
		alias Edge = Tuple !(int, q{v}, int, q{c});
		auto g = new Edge [] [n];
		auto h = new Edge [] [n];
		foreach (j; 0..m)
		{
			int u, v, a, b;
			readf (" %s %s %s %s", &u, &v, &a, &b);
			u -= 1;
			v -= 1;
			g[u] ~= Edge (v, a);
			g[v] ~= Edge (u, a);
			h[u] ~= Edge (v, b);
			h[v] ~= Edge (u, b);
		}

		auto shortestPaths (ref Edge [] [] a, int x)
		{
			auto d = new long [n];
			d[] = long.max;
			d[x] = 0;
			alias Record = Tuple !(long, q{d}, int, q{v});
			auto t = redBlackTree !(Record);
			foreach (v; 0..n)
			{
				t.insert (Record (d[v], v));
			}
			while (!t.empty)
			{
				auto v = t.front.v;
				t.removeFront ();
				foreach (ref edge; a[v])
				{
					auto u = edge.v;
					auto r = d[v] + edge.c;
					if (d[u] > r)
					{
						t.removeKey (Record (d[u], u));
						d[u] = r;
						t.insert (Record (d[u], u));
					}
				}
			}
			return d;
		}

		auto d = shortestPaths (g, s);
		auto e = shortestPaths (h, t);

		auto f = new long [n + 1];
		f[$ - 1] = long.max;
		foreach_reverse (i; 0..n)
		{
			f[i] = min (f[i + 1], d[i] + e[i]);
		}

		f[] = 10L ^^ 15 - f[];
		writefln ("%(%s\n%)", f[0..n]);
	}
}
