using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;


public struct Edge
{
	public int To;
	public long Cost;

	public Edge(int to, long cost)
	{
		To = to;
		Cost = cost;
	}
}

public class D
{
	public static void Main() => (new Solver()).Solve();
}


public class Solver
{
	public void Solve()
	{
		int N = GetInt();
		int M = GetInt();
		int s = GetInt() - 1;
		int t = GetInt() - 1;
		var adjYen = Enumerable.Range(0, N).Select(_ => new List<Edge>()).ToArray();
		var adjSnuuk = Enumerable.Range(0, N).Select(_ => new List<Edge>()).ToArray();
		for(int i = 0; i < M; i++)
		{
			int u = GetInt() - 1;
			int v = GetInt() - 1;
			long a = GetLong();
			long b = GetLong();
			adjYen[u].Add(new Edge(v, a));
			adjYen[v].Add(new Edge(u, a));
			adjSnuuk[u].Add(new Edge(v, b));
			adjSnuuk[v].Add(new Edge(u, b));
		}

		long[] go = dijkstra(adjYen, s);
		long[] back = dijkstra(adjSnuuk, t);
		var st = new SegmentTree<long>(N, long.MaxValue / 2, (x, y) => (long)Math.Min(x, y));
		for(int i = 0; i < N; i++)
			st.Update(i, go[i] + back[i]);

		string[] ans = new string[N];
		for(int i = 0; i < N; i++)
			ans[i] = ((long)1e15 - st.Query(i, N)).ToString();
		Console.WriteLine(string.Join("\n", ans));
	}

	private long[] dijkstra(List<Edge>[] adj, int s)
	{
		Comparison<Tuple<long, int>> comp = ((x, y) => x.Item1.CompareTo(y.Item1));
		var pq = new PriorityQueue<Tuple<long, int>>(adj.Length, comp);

		long[] d = Enumerable.Repeat(long.MaxValue / 2, adj.Length).ToArray();
		d[s] = 0;
		pq.Push(Tuple.Create(0L, s));
		while(pq.Size > 0)
		{
			var p = pq.Pop();
			int v = p.Item2;
			if(d[v] < p.Item1)
				continue;
			for(int i = 0; i < adj[v].Count; i++)
			{
				var edge = adj[v][i];
				if(d[edge.To] > d[v] + edge.Cost)
				{
					d[edge.To] = d[v] + edge.Cost;
					pq.Push(Tuple.Create(d[edge.To], edge.To));
				}
			}
		}

		return d;
	}
}


public class PriorityQueue<T>
{
	public long Size { get; private set; } = 0;
	public long MaxSize { get; private set; } = 0;
	private T[] m_heap;
	private Comparison<T> Comp = null;
	
	public PriorityQueue(long maxSize, Comparison<T> comp)
	{
		if(maxSize <= 0)
			throw new Exception();
		MaxSize = maxSize;
		m_heap = new T[maxSize];

		Comp = comp;
	}
	
	public void Push(T x)
	{
		if(Size == MaxSize)
		{
			T[] new_heap = new T[MaxSize << 1];
			Array.Copy(m_heap, new_heap, MaxSize);
			m_heap = new_heap;
			MaxSize <<= 1;
		}
		
		long i = Size++;
		while(i > 0)
		{
			long p = (i - 1)/2;
			if(Comp(m_heap[p], x) <= 0)
				break;
			m_heap[i] = m_heap[p];
			i = p;			
		}
		m_heap[i] = x;		
	}
	
	public T Pop()
	{
		if(Size == 0)
			throw new Exception("Queue is empty.");
		
		T result = m_heap[0];
		T x = m_heap[--Size];
		long i = 0;
		while(i * 2 + 1 < Size)
		{
			long c1 = i * 2 + 1, c2 = i * 2 + 2;
			if(c2 < Size && Comp(m_heap[c2], m_heap[c1]) < 0)
				c1 = c2;
			if(Comp(m_heap[c1], x) >= 0)
				break;
			m_heap[i] = m_heap[c1];
			i = c1;
		}
		m_heap[i] = x;
		
		return result;		
	}	
}


public class SegmentTree<T>
{
	private int N;
	private T INI;
	private Func<T, T, T> Func;
	private T[] dat;

	public SegmentTree(int n, T ini, Func<T, T, T> func)
	{
		N = 1;		
		while(N < n)
			N <<= 1;

		INI = ini;
		Func = func;
			
		dat = new T[2 * N - 1];
		for(int i = 0; i < 2 * N - 1; i++)
			dat[i] = INI;
	}

	public void Update(int k, T a)
	{
		k += N - 1;
		dat[k] = a;
		while(k > 0)
		{
			k = (k - 1) / 2;
			dat[k] = Func(dat[k * 2 + 1], dat[k * 2 + 2]);
		}
	}

	public T Query(int a, int b, int k = 0, int l = 0, int r = -1)
	{
		if(r == -1)
			r = N;

		if(r <= a || b <= l)
			return INI;

		if(a <= l && r <= b)
			return dat[k];
		else
		{
			T vl = Query(a, b, k * 2 + 1, l, (l + r) / 2);
			T vr = Query(a, b, k * 2 + 2, (l + r) / 2, r);
			return Func(vl, vr);
		}
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
}


Measured memory_bytes: 67944