#!/usr/bin/env python3

from collections import defaultdict,deque

from heapq import heappush, heappop

from bisect import bisect_left, bisect_right

import sys, random, itertools, math

sys.setrecursionlimit(10**5)

input = sys.stdin.readline

sqrt = math.sqrt

def LI(): return list(map(int, input().split()))

def LF(): return list(map(float, input().split()))

def LI_(): return list([int(x)-1 for x in input().split()])

def II(): return int(eval(input()))

def IF(): return float(eval(input()))

def LS(): return list(map(list, input().split()))

def S(): return list(input().rstrip())

def IR(n): return [II() for _ in range(n)]

def LIR(n): return [LI() for _ in range(n)]

def FR(n): return [IF() for _ in range(n)]

def LFR(n): return [LI() for _ in range(n)]

def LIR_(n): return [LI_() for _ in range(n)]

def SR(n): return [S() for _ in range(n)]

def LSR(n): return [LS() for _ in range(n)]

mod = 1000000007

inf = 1e10



def Dijkstra(num, start, vedge):

    """ vedge は DAG の 重みとして vedge[from] = (to, value)　としておくこと """

    """ DAGでない場合は vedge[from] と vedge[to] の両方を作ること """

    """ dist[i] は start から i までの最短距離 """



    dist = [float("inf") for i in range(num)]

    dist[start] = 0

    q = [[dist[start], start]]

    while q:

        du, u = heappop(q)

        for j, k in vedge[u]:

            if dist[j] > du + k:

                dist[j] = du + k

                heappush(q, [dist[j], j])

    return dist







#solve

def solve():

    n, m, s, t = LI()

    s -= 1

    t -= 1

    uva = defaultdict(list)

    uvb = defaultdict(list)

    for _ in range(m):

        u, v, a, b = LI_()

        a += 1

        b += 1

        uva[u].append((v, a))

        uva[v].append((u, a))

        uvb[u].append((v, b))

        uvb[v].append((u, b))

    dista = Dijkstra(n, s, uva)

    distb = Dijkstra(n, t, uvb)

    a = [None] * n

    for i in range(n):

        a[i] = dista[i] + distb[i]

    a = a[::-1]

    for i in range(1,n):

        a[i] = min(a[i], a[i - 1])

    a = a[::-1]

    for i in range(n):

        print((10**15-a[i]))

    return





#main

if __name__ == '__main__':

    solve()

from heapq import*

def dijkstra(s,e):

  g=10**6;d=[10**18]*n;f=[1]*n;d[s]=f[s]=0;q=[]

  for a,b in e[s]:heappush(q,a*g+b)

  while q:

    m=heappop(q)

    if f[m%g]<1:continue

    v=m%g

    x=d[v]=m//g

    f[v]=0

    for y,w in e[v]:

      if f[w]:heappush(q,(x+y)*g+w)

  return d

(n,m,s,t),*z=[list(map(int,t.split()))for t in open(0)]

e,f=eval('[[]for _ in"_"*n],'*2)

for u,v,a,b in z:

  u-=1

  v-=1

  e[u]+=(a,v),

  e[v]+=(a,u),

  f[u]+=(b,v),

  f[v]+=(b,u),

a=[]

m=0

for y,s in zip(dijkstra(s-1,e)[::-1],dijkstra(t-1,f)[::-1]):

  m=max(m,10**15-y-s)

  a+=m,

print((*a[::-1]))

#!/usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math

sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt


def LI():
    return list(map(int, input().split()))


def LF():
    return list(map(float, input().split()))


def LI_():
    return list([int(x) - 1 for x in input().split()])


def II():
    return int(eval(input()))


def IF():
    return float(eval(input()))


def LS():
    return list(map(list, input().split()))


def S():
    return list(input().rstrip())


def IR(n):
    return [II() for _ in range(n)]


def LIR(n):
    return [LI() for _ in range(n)]


def FR(n):
    return [IF() for _ in range(n)]


def LFR(n):
    return [LI() for _ in range(n)]


def LIR_(n):
    return [LI_() for _ in range(n)]


def SR(n):
    return [S() for _ in range(n)]


def LSR(n):
    return [LS() for _ in range(n)]


mod = 1000000007
inf = 1e10


def Dijkstra(num, start, vedge):
    """vedge は DAG の 重みとして vedge[from] = (to, value)　としておくこと"""
    """ DAGでない場合は vedge[from] と vedge[to] の両方を作ること """
    """ dist[i] は start から i までの最短距離 """
    dist = [float("inf") for i in range(num)]
    dist[start] = 0
    q = [[dist[start], start]]
    while q:
        du, u = heappop(q)
        for j, k in vedge[u]:
            if dist[j] > du + k:
                dist[j] = du + k
                heappush(q, [dist[j], j])
    return dist


# solve
def solve():
    n, m, s, t = LI()
    s -= 1
    t -= 1
    uva = defaultdict(list)
    uvb = defaultdict(list)
    for _ in range(m):
        u, v, a, b = LI_()
        a += 1
        b += 1
        uva[u].append((v, a))
        uva[v].append((u, a))
        uvb[u].append((v, b))
        uvb[v].append((u, b))
    dista = Dijkstra(n, s, uva)
    distb = Dijkstra(n, t, uvb)
    a = [None] * n
    for i in range(n):
        a[i] = dista[i] + distb[i]
    a = a[::-1]
    for i in range(1, n):
        a[i] = min(a[i], a[i - 1])
    a = a[::-1]
    for i in range(n):
        print((10**15 - a[i]))
    return


# main
if __name__ == "__main__":
    solve()

from heapq import *


def dijkstra(s, e):
    g = 10**6
    d = [10**18] * n
    f = [1] * n
    d[s] = f[s] = 0
    q = []
    for a, b in e[s]:
        heappush(q, a * g + b)
    while q:
        m = heappop(q)
        if f[m % g] < 1:
            continue
        v = m % g
        x = d[v] = m // g
        f[v] = 0
        for y, w in e[v]:
            if f[w]:
                heappush(q, (x + y) * g + w)
    return d


(n, m, s, t), *z = [list(map(int, t.split())) for t in open(0)]
e, f = eval('[[]for _ in"_"*n],' * 2)
for u, v, a, b in z:
    u -= 1
    v -= 1
    e[u] += ((a, v),)
    e[v] += ((a, u),)
    f[u] += ((b, v),)
    f[v] += ((b, u),)
a = []
m = 0
for y, s in zip(dijkstra(s - 1, e)[::-1], dijkstra(t - 1, f)[::-1]):
    m = max(m, 10**15 - y - s)
    a += (m,)
print((*a[::-1]))

-#!/usr/bin/env python3 -from collections import defaultdict, deque -from heapq import heappush, heappop -from bisect import bisect_left, bisect_right -import sys, random, itertools, math - -sys.setrecursionlimit(10**5) -input = sys.stdin.readline -sqrt = math.sqrt +from heapq import * -def LI(): -    return list(map(int, input().split())) +def dijkstra(s, e): +    g = 10**6 +    d = [10**18] * n +    f = [1] * n +    d[s] = f[s] = 0 +    q = [] +    for a, b in e[s]: +        heappush(q, a * g + b) +    while q: +        m = heappop(q) +        if f[m % g] < 1: +            continue +        v = m % g +        x = d[v] = m // g +        f[v] = 0 +        for y, w in e[v]: +            if f[w]: +                heappush(q, (x + y) * g + w) +    return d -def LF(): -    return list(map(float, input().split())) - - -def LI_(): -    return list([int(x) - 1 for x in input().split()]) - - -def II(): -    return int(eval(input())) - - -def IF(): -    return float(eval(input())) - - -def LS(): -    return list(map(list, input().split())) - - -def S(): -    return list(input().rstrip()) - - -def IR(n): -    return [II() for _ in range(n)] - - -def LIR(n): -    return [LI() for _ in range(n)] - - -def FR(n): -    return [IF() for _ in range(n)] - - -def LFR(n): -    return [LI() for _ in range(n)] - - -def LIR_(n): -    return [LI_() for _ in range(n)] - - -def SR(n): -    return [S() for _ in range(n)] - - -def LSR(n): -    return [LS() for _ in range(n)] - - -mod = 1000000007 -inf = 1e10 - - -def Dijkstra(num, start, vedge): -    """vedge は DAG の 重みとして vedge[from] = (to, value)　としておくこと""" -    """ DAGでない場合は vedge[from] と vedge[to] の両方を作ること """ -    """ dist[i] は start から i までの最短距離 """ -    dist = [float("inf") for i in range(num)] -    dist[start] = 0 -    q = [[dist[start], start]] -    while q: -        du, u = heappop(q) -        for j, k in vedge[u]: -            if dist[j] > du + k: -                dist[j] = du + k -                heappush(q, [dist[j], j]) -    return dist - - -# solve -def solve(): -    n, m, s, t = LI() -    s -= 1 -    t -= 1 -    uva = defaultdict(list) -    uvb = defaultdict(list) -    for _ in range(m): -        u, v, a, b = LI_() -        a += 1 -        b += 1 -        uva[u].append((v, a)) -        uva[v].append((u, a)) -        uvb[u].append((v, b)) -        uvb[v].append((u, b)) -    dista = Dijkstra(n, s, uva) -    distb = Dijkstra(n, t, uvb) -    a = [None] * n -    for i in range(n): -        a[i] = dista[i] + distb[i] -    a = a[::-1] -    for i in range(1, n): -        a[i] = min(a[i], a[i - 1]) -    a = a[::-1] -    for i in range(n): -        print((10**15 - a[i])) -    return - - -# main -if __name__ == "__main__": -    solve() +(n, m, s, t), *z = [list(map(int, t.split())) for t in open(0)] +e, f = eval('[[]for _ in"_"*n],' * 2) +for u, v, a, b in z: +    u -= 1 +    v -= 1 +    e[u] += ((a, v),) +    e[v] += ((a, u),) +    f[u] += ((b, v),) +    f[v] += ((b, u),) +a = [] +m = 0 +for y, s in zip(dijkstra(s - 1, e)[::-1], dijkstra(t - 1, f)[::-1]): +    m = max(m, 10**15 - y - s) +    a += (m,) +print((*a[::-1]))