using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace AtCoder
{
    class Program
    {
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        class City
        {
            public readonly int v;
            public readonly int a;
            public readonly int b;
            public City(int v, int a, int b)
            {
                this.v = v;
                this.a = a;
                this.b = b;
            }
        }
        static IEnumerable<long> Solve(int n, int m, int s, int t, List<City>[] cities)
        {
            long[] yen = Enumerable.Repeat(long.MaxValue, n).ToArray();
            {
                var q = new Queue<int>();
                q.Enqueue(s);
                yen[s] = 0;
                while (q.Count > 0)
                {
                    int u = q.Dequeue();
                    foreach (var city in cities[u])
                    {
                        int v = city.v;
                        if (yen[u] + city.a < yen[v])
                        {
                            yen[v] = yen[u] + city.a;
                            q.Enqueue(v);
                        }
                    }
                }
            }
            long[] snk = Enumerable.Repeat(long.MaxValue, n).ToArray();
            {
                var q = new Queue<int>();
                q.Enqueue(t);
                snk[t] = 0;
                while (q.Count > 0)
                {
                    int u = q.Dequeue();
                    foreach (var city in cities[u])
                    {
                        int v = city.v;
                        if (snk[u] + city.b < snk[v])
                        {
                            snk[v] = snk[u] + city.b;
                            q.Enqueue(v);
                        }
                    }
                }
            }
            var values = new long[n];
            values[n - 1] = yen[n - 1] + snk[n - 1];
            for (int i = n - 2; i >= 0; --i)
            {
                values[i] = Math.Min(yen[i] + snk[i], values[i + 1]);
            }
            return values.Select(value => 1000000000000000L - value);
        }
        static void Main(string[] args)
        {
            int[] V1 = ReadInts();
            int n = V1[0];
            int m = V1[1];
            int s = V1[2] - 1;
            int t = V1[3] - 1;
            var cities = new List<City>[n];
            for (int i = 0; i < n; ++i) { cities[i] = new List<City>(); }
            for (int i = 0; i < m; ++i)
            {
                int[] V2 = ReadInts();
                int u = V2[0] - 1;
                int v = V2[1] - 1;
                int a = V2[2];
                int b = V2[3];
                cities[u].Add(new City(v, a, b));
                cities[v].Add(new City(u, a, b));
            }
            foreach (long ans in Solve(n, m, s, t, cities))
            {
                Console.WriteLine(ans);
            }
        }
    }
}


Measured memory_bytes: 41500