using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Competitive
{
    internal class Solution
    {
        public int N, M, S, T;
        public Graph G;
        public void Run()
        {
            // Input
            {
                var line = Input.ReadIntArray();
                N = line[0];
                M = line[1];
                S = line[2] - 1;
                T = line[3] - 1;
            }

            G = new Graph(N);

            for (int i = 0; i < M; i++)
            {
                var line = Input.ReadIntArray();
                int u = line[0] - 1;
                int v = line[1] - 1;
                int jpy = line[2];
                int snk = line[3];
                G[u].Edges.Add(new Edge(u, v, jpy, snk));
                G[v].Edges.Add(new Edge(v, u, jpy, snk));
            }

            // JPY S -> i
            {
                var pq = new PriorityQueue<EdgeData>();
                pq.Push(new EdgeData(0, new Edge(-1, S, 0, 0)));

                while (pq.Count() > 0)
                {
                    var d = pq.Pop();
                    var n = G[d.Edge.To];
                    if (n.DistJPY != long.MaxValue) continue;

                    n.DistJPY = d.Dist;
                    foreach (var ee in n.Edges)
                    {
                        pq.Push(new EdgeData(d.Dist + ee.CostJPY, ee));
                    }
                }
            }

            // SNK T -> i
            {
                var pq = new PriorityQueue<EdgeData>();
                pq.Push(new EdgeData(0, new Edge(-1, T, 0, 0)));

                while (pq.Count() > 0)
                {
                    var d = pq.Pop();
                    var n = G[d.Edge.To];
                    if (n.DistSNK != long.MaxValue) continue;

                    n.DistSNK = d.Dist;
                    foreach (var ee in n.Edges)
                    {
                        pq.Push(new EdgeData(d.Dist + ee.CostSNK, ee));
                    }
                }
            }

            var ret = new long[N];
            for (int i = N - 1; i >= 0; i--)
            {
                long a = G[i].DistJPY + G[i].DistSNK;
                long r = i == N - 1 ? a : Math.Min(ret[i + 1], a);
                ret[i] = r;
            }

            for(int i = 0; i < N; i++)
                Console.WriteLine(1000000000000000L - ret[i]);
        }
    }

    // libs ----------

    public class PriorityQueue<T> where T : IComparable<T>
    {
        private IComparer<T> _comparer = null;
        private int _type = 0;

        private T[] _heap;
        private int _sz = 0;

        private int _count = 0;

        /// <summary>
        /// Priority Queue with custom comparer
        /// </summary>
        public PriorityQueue(IComparer<T> comparer)
        {
            _heap = new T[128];
            _comparer = comparer;
        }

        /// <summary>
        /// Priority queue
        /// </summary>
        /// <param name="type">0: asc, 1:desc</param>
        public PriorityQueue(int type = 0)
        {
            _heap = new T[128];
            _type = type;
        }

        private int Compare(T x, T y)
        {
            if (_comparer != null) return _comparer.Compare(x, y);
            return _type == 0 ? x.CompareTo(y) : y.CompareTo(x);
        }

        public void Push(T x)
        {
            _count++;
            if (_count > _heap.Length)
            {
                var newheap = new T[_heap.Length * 2];
                for (int n = 0; n < _heap.Length; n++) newheap[n] = _heap[n];
                _heap = newheap;
            }

            //node number
            var i = _sz++;

            while (i > 0)
            {
                //parent node number
                var p = (i - 1) / 2;

                if (Compare(_heap[p], x) <= 0) break;

                _heap[i] = _heap[p];
                i = p;
            }

            _heap[i] = x;
        }

        public T Pop()
        {
            _count--;

            T ret = _heap[0];
            T x = _heap[--_sz];

            int i = 0;
            while (i * 2 + 1 < _sz)
            {
                //children
                int a = i * 2 + 1;
                int b = i * 2 + 2;

                if (b < _sz && Compare(_heap[b], _heap[a]) < 0) a = b;

                if (Compare(_heap[a], x) >= 0) break;

                _heap[i] = _heap[a];
                i = a;
            }

            _heap[i] = x;

            return ret;
        }

        public int Count()
        {
            return _count;
        }

        public T Peek()
        {
            return _heap[0];
        }

        public bool Contains(T x)
        {
            for (int i = 0; i < _sz; i++) if (x.Equals(_heap[i])) return true;
            return false;
        }

        public void Clear()
        {
            while (this.Count() > 0) this.Pop();
        }

        public IEnumerator<T> GetEnumerator()
        {
            var ret = new List<T>();

            while (this.Count() > 0)
            {
                ret.Add(this.Pop());
            }

            foreach (var r in ret)
            {
                this.Push(r);
                yield return r;
            }
        }

        public T[] ToArray()
        {
            T[] array = new T[_sz];
            int i = 0;

            foreach (var r in this)
            {
                array[i++] = r;
            }

            return array;
        }
    }

    // 通常はIComparableのみが必要
    class EdgeData : IComparable<EdgeData>, IComparable
    {
        public long Dist;
        public Edge Edge;
        public EdgeData(long dist, Edge edge)
        {
            Dist = dist;
            Edge = edge;
        }

        public int CompareTo(EdgeData other)
        {
            return Dist.CompareTo(other.Dist);
        }

        public int CompareTo(object obj)
        {
            if (obj == null) return 1;
            if (GetType() != obj.GetType()) throw new ArgumentException();
            return CompareTo((EdgeData)obj);
        }
    }

    internal class Graph
    {
        public List<Node> Nodes;

        public Node this[int i]
        {
            set { Nodes[i] = value; }
            get { return Nodes[i]; }
        }

        public Graph(int N)
        {
            Nodes = new List<Node>();
            for (int i = 0; i < N; i++)
            {
                Nodes.Add(new Node(i));
            }
        }

    }

    internal class Node
    {
        public List<Edge> Edges;
        public long DistJPY;
        public long DistSNK;
        public int No;

        public Node(int no)
        {
            this.No = no;
            DistJPY = long.MaxValue;
            DistSNK = long.MaxValue;
            Edges = new List<Edge>();
        }
    }

    internal class Edge
    {
        public int From;
        public int To;
        public long CostJPY;
        public long CostSNK;

        public Edge(int fr, int to, long costJPY, long costSNK)
        {
            From = fr;
            To = to;
            CostJPY = costJPY;
            CostSNK = costSNK;
        }

    }

    // common ----------

    internal static class Input
    {
        public static string ReadString()
        {
            string line = Console.ReadLine();
            return line;
        }

        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static long ReadLong()
        {
            string line = Console.ReadLine();
            return long.Parse(line);
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}

Measured memory_bytes: 54120