using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PriorityQueue;
class N
{
    public List<int> adj; //隣接する頂点の番号
    public List<int> a; //各隣接する頂点までのa
    public List<int> b; //各隣接する頂点までのb
    public N()
    {
        adj = new List<int>();
        a = new List<int>();
        b = new List<int>();
    }
}
class Pair : IComparer<Pair>
{
    public int id;
    public long cost;
    public Pair(int id, long cost)
    {
        this.id = id;
        this.cost = cost;
    }
    int IComparer<Pair>.Compare(Pair x, Pair y)
    {
        return (x.cost < y.cost) ? -1 : (x.cost == y.cost) ? 0 : 1;
    }
}
class P
{
    static long inf = long.MaxValue;
    static int n;
    static N[] g;
    static void Main()
    {
        n = ReadInt();
        g = new N[n];
        for (int i = 0; i < n; i++) g[i] = new N();
        int m = ReadInt();
        int s = ReadInt() - 1;
        int t = ReadInt() - 1;
        for (int i = 0; i < m; i++)
        {
            int u = ReadInt() - 1;
            int v = ReadInt() - 1;
            int a = ReadInt();
            int b = ReadInt();
            g[u].adj.Add(v);
            g[v].adj.Add(u);
            g[u].a.Add(a);
            g[v].a.Add(a);
            g[u].b.Add(b);
            g[v].b.Add(b);
        }
        Pair[] yen = new Pair[n];
        for (int i = 0; i < n; i++) yen[i] = new Pair(i, inf);
        { //sからyenだけで各頂点に行く最小コスト
            PriorityQueue<Pair> Q = new PriorityQueue<Pair>(yen[0]);
            yen[s].cost = 0;
            Q.Enqueue(yen[s]);
            while (Q.Count != 0)
            {
                var u = Q.Dequeue();
                for (int i = 0; i < g[u.id].adj.Count; i++)
                {
                    var alt = u.cost + g[u.id].a[i];
                    var v = g[u.id].adj[i];
                    if (yen[v].cost > alt)
                    {
                        yen[v].cost = alt;
                        Q.Enqueue(yen[v]);
                    }
                }
            }
        }
        /*
        foreach (var i in yen)
            WriteLine(i.cost);
        */
        Pair[] snuuk = new Pair[n];
        for (int i = 0; i < n; i++) snuuk[i] = new Pair(i, inf);
        { //各頂点からtまでsnuukだけで行く最小コスト
            PriorityQueue<Pair> Q = new PriorityQueue<Pair>(snuuk[0]);
            snuuk[t].cost = 0;
            Q.Enqueue(snuuk[t]);
            while (Q.Count != 0)
            {
                var u = Q.Dequeue();
                for (int i = 0; i < g[u.id].adj.Count; i++)
                {
                    var alt = u.cost + g[u.id].b[i];
                    var v = g[u.id].adj[i];
                    if (snuuk[v].cost > alt)
                    {
                        snuuk[v].cost = alt;
                        Q.Enqueue(snuuk[v]);
                    }
                }
            }
        }
        /*
        foreach (var i in snuuk)
            WriteLine(i.cost);
        */
        long[] c = new long[n];
        for (int i = 0; i < n; i++)
            c[i] = yen[i].cost + snuuk[i].cost;
        long[] cost = new long[n];
        for (int i = n - 1; i >= 0; i--)
        {
            if (i == n - 1)
            {
                cost[i] = c[i];
                continue;
            }
            cost[i] = Math.Min(cost[i + 1], c[i]);
        }
        foreach (var i in cost)
            WriteLine(1000000000000000 - i);
    }
    //以下標準出入力用のメソッド
    [System.Runtime.InteropServices.DllImport("msvcrt.dll")]
    private static extern int scanf(string format, out long l);
    [System.Runtime.InteropServices.DllImport("msvcrt.dll")]
    private static extern int scanf(string format, out double l);
    [System.Runtime.InteropServices.DllImport("msvcrt.dll")]
    private static extern int scanf(string format, out char c);
    public static long ReadLong()
    {
        long l;
        scanf("%ld", out l);
        return l;
    }
    public static int ReadInt()
    {
        return (int)ReadLong();
    }
    public static int[] ReadInts(int n)
    {
        int[] nums = new int[n];
        for (int i = 0; i < n; i++)
            nums[i] = ReadInt();
        return nums;
    }
    public static long[] ReadLongs(int n)
    {
        long[] nums = new long[n];
        for (int i = 0; i < n; i++)
            nums[i] = ReadLong();
        return nums;
    }
    public static string[] ReadStrs(int n)
    {
        string[] s = new string[n];
        for (int i = 0; i < n; i++)
            s[i] = ReadStr();
        return s;
    }
    public static double ReadDouble()
    {
        double d;
        scanf("%lf", out d);
        return d;
    }
    public static char ReadChar()
    {
        char c;
        while (true)
        {
            scanf("%c", out c);
            if (c != '\n' && c != ' ')
                break;
        }
        return c;
    }
    public static string ReadStr()
    {
        StringBuilder sb = new StringBuilder();
        char c;
        do
        {
            scanf("%c", out c);
        } while (c == '\n' || c == ' ');
        sb.Append(c);
        while (true)
        {
            scanf("%c", out c);
            if (c == '\n' || c == ' ')
                break;
            sb.Append(c);
        }
        return sb.ToString();
    }
    public static string ReadLine()
    {
        StringBuilder sb = new StringBuilder();
        char c;
        do
        {
            scanf("%c", out c);
            if (c != '\n')
                sb.Append(c);
        } while (c != '\n');
        return sb.ToString();
    }
    [System.Runtime.InteropServices.DllImport("msvcrt.dll")]
    private static extern void printf(string s);
    public static void Write(string s) { printf(s); }
    public static void Write(char c) { printf(c.ToString()); }
    public static void Write(long n) { printf(n.ToString()); }
    public static void Write(int n) { printf(n.ToString()); }
    public static void Write(double d) { printf(d.ToString()); }
    public static void WriteLine() { printf("\n"); }
    public static void WriteLine(string s) { printf(s + "\n"); }
    public static void WriteLine(char c) { WriteLine(c.ToString()); }
    public static void WriteLine(long n) { WriteLine(n.ToString()); }
    public static void WriteLine(int n) { WriteLine(n.ToString()); }
    public static void WriteLine(double d) { WriteLine(d.ToString()); }
    public static void WriteLine(string[] s)
    {
        for (int i = 0; i < s.Length - 1; i++)
            Write(s[i] + " ");
        WriteLine(s[s.Length - 1]);
    }
    public static void WriteLine(char[] c)
    {
        for (int i = 0; i < c.Length - 1; i++)
            Write(c[i] + " ");
        WriteLine(c[c.Length - 1]);
    }
    public static void WriteLine(long[] n)
    {
        for (int i = 0; i < n.Length - 1; i++)
            Write(n[i] + " ");
        WriteLine(n[n.Length - 1]);
    }
    public static void WriteLine<T>(ICollection<T> ic)
    {
        foreach (var i in ic)
            Write(i + " ");
        WriteLine("\b");
    }
    public static void WriteLine(int[] n)
    {
        for (int i = 0; i < n.Length - 1; i++)
            Write(n[i] + " ");
        WriteLine(n[n.Length - 1]);
    }
    public static void WriteLine(double[] d)
    {
        for (int i = 0; i < d.Length - 1; i++)
            Write(d[i] + " ");
        WriteLine(d[d.Length - 1]);
    }
    public static void WriteLines(string[] s) { foreach (var i in s) WriteLine(i); }
    public static void WriteLines(char[] c) { foreach (var i in c) WriteLine(i); }
    public static void WriteLines(long[] c) { foreach (var i in c) WriteLine(i); }
    public static void WriteLines(int[] c) { foreach (var i in c) WriteLine(i); }
    public static void WriteLines(double[] d) { foreach (var i in d) WriteLine(i); }
    public static void WriteLines<T>(ICollection<T> ic) { WriteLines(ic.ToArray()); }
}
namespace PriorityQueue
{
    using System;
    using System.Collections.Generic;
    class PriorityQueue<T>
    {
        private readonly List<T> heap;
        private readonly Comparison<T> compare;
        private int size;
        public PriorityQueue() : this(Comparer<T>.Default) { }
        public PriorityQueue(IComparer<T> comparer) : this(16, comparer.Compare) { }
        public PriorityQueue(Comparison<T> comparison) : this(16, comparison) { }
        public PriorityQueue(int capacity, Comparison<T> comparison)
        {
            this.heap = new List<T>(capacity);
            this.compare = comparison;
        }
        public void Enqueue(T item)
        {
            this.heap.Add(item);
            var i = size++;
            while (i > 0)
            {
                var p = (i - 1) >> 1;
                if (compare(this.heap[p], item) <= 0)
                    break;
                this.heap[i] = heap[p];
                i = p;
            }
            this.heap[i] = item;

        }
        public T Dequeue()
        {
            var ret = this.heap[0];
            var x = this.heap[--size];
            var i = 0;
            while ((i << 1) + 1 < size)
            {
                var a = (i << 1) + 1;
                var b = (i << 1) + 2;
                if (b < size && compare(heap[b], heap[a]) < 0) a = b;
                if (compare(heap[a], x) >= 0)
                    break;
                heap[i] = heap[a];
                i = a;
            }
            heap[i] = x;
            heap.RemoveAt(size);
            return ret;
        }
        public T Peek() { return heap[0]; }
        public int Count { get { return size; } }
        public bool Any() { return size > 0; }
    }
}

Measured memory_bytes: 59148