n,m,s,t=list(map(int,input().split()))



en=[[]for i in range(n+1)]

sn=[[]for i in range(n+1)]



for i in range(m):

    u,v,a,b=list(map(int,input().split()))

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

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

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

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

#print(en)



import numpy as np

INF=10**20



def dijkstra(S, N, paths):

    from heapq import heappush,heappop

    q=[(0,S)]

    shortest=[INF]*N

    shortest[S]=0

    while len(q)>0:

        d0, src=heappop(q)

        if d0>shortest[src]:

            continue

        for dst, d1 in paths[src]:

            if d0+d1<shortest[dst]:

                shortest[dst]=d0+d1

                heappush(q, (d0+d1, dst))

    return np.array(shortest)

    

en=dijkstra(s,n+1,en)

sn=dijkstra(t,n+1,sn)



cost=[]

for i in range(1,n+1):

    cost.append(en[i]+sn[i])

cost=cost[::-1]

#print(cost)



ans=[]

mi=cost[0]

for i in range(n):

    ans.append(min(mi,cost[i]))

    mi=min(mi,cost[i])

ans=ans[::-1]

#print(ans)

for i in ans:

    print((10**15-i))

import sys

input=sys.stdin.readline

n,m,s,t=list(map(int,input().split()))



en=[[]for i in range(n+1)]

sn=[[]for i in range(n+1)]



for i in range(m):

    u,v,a,b=list(map(int,input().split()))

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

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

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

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

#print(en)



import numpy as np

INF=10**20



def dijkstra(S, N, paths):

    from heapq import heappush,heappop

    q=[(0,S)]

    shortest=[INF]*N

    shortest[S]=0

    while len(q)>0:

        d0, src=heappop(q)

        if d0>shortest[src]:

            continue

        for dst, d1 in paths[src]:

            if d0+d1<shortest[dst]:

                shortest[dst]=d0+d1

                heappush(q, (d0+d1, dst))

    return np.array(shortest)

    

en=dijkstra(s,n+1,en)

sn=dijkstra(t,n+1,sn)



cost=[]

for i in range(1,n+1):

    cost.append(en[i]+sn[i])

cost=cost[::-1]

#print(cost)



ans=[]

mi=cost[0]

for i in range(n):

    ans.append(min(mi,cost[i]))

    mi=min(mi,cost[i])

ans=ans[::-1]

#print(ans)

for i in ans:

    print((10**15-i))

n, m, s, t = list(map(int, input().split()))
en = [[] for i in range(n + 1)]
sn = [[] for i in range(n + 1)]
for i in range(m):
    u, v, a, b = list(map(int, input().split()))
    en[v].append((u, a))
    en[u].append((v, a))
    sn[v].append((u, b))
    sn[u].append((v, b))
# print(en)
import numpy as np

INF = 10**20


def dijkstra(S, N, paths):
    from heapq import heappush, heappop

    q = [(0, S)]
    shortest = [INF] * N
    shortest[S] = 0
    while len(q) > 0:
        d0, src = heappop(q)
        if d0 > shortest[src]:
            continue
        for dst, d1 in paths[src]:
            if d0 + d1 < shortest[dst]:
                shortest[dst] = d0 + d1
                heappush(q, (d0 + d1, dst))
    return np.array(shortest)


en = dijkstra(s, n + 1, en)
sn = dijkstra(t, n + 1, sn)
cost = []
for i in range(1, n + 1):
    cost.append(en[i] + sn[i])
cost = cost[::-1]
# print(cost)
ans = []
mi = cost[0]
for i in range(n):
    ans.append(min(mi, cost[i]))
    mi = min(mi, cost[i])
ans = ans[::-1]
# print(ans)
for i in ans:
    print((10**15 - i))

import sys

input = sys.stdin.readline
n, m, s, t = list(map(int, input().split()))
en = [[] for i in range(n + 1)]
sn = [[] for i in range(n + 1)]
for i in range(m):
    u, v, a, b = list(map(int, input().split()))
    en[v].append((u, a))
    en[u].append((v, a))
    sn[v].append((u, b))
    sn[u].append((v, b))
# print(en)
import numpy as np

INF = 10**20


def dijkstra(S, N, paths):
    from heapq import heappush, heappop

    q = [(0, S)]
    shortest = [INF] * N
    shortest[S] = 0
    while len(q) > 0:
        d0, src = heappop(q)
        if d0 > shortest[src]:
            continue
        for dst, d1 in paths[src]:
            if d0 + d1 < shortest[dst]:
                shortest[dst] = d0 + d1
                heappush(q, (d0 + d1, dst))
    return np.array(shortest)


en = dijkstra(s, n + 1, en)
sn = dijkstra(t, n + 1, sn)
cost = []
for i in range(1, n + 1):
    cost.append(en[i] + sn[i])
cost = cost[::-1]
# print(cost)
ans = []
mi = cost[0]
for i in range(n):
    ans.append(min(mi, cost[i]))
    mi = min(mi, cost[i])
ans = ans[::-1]
# print(ans)
for i in ans:
    print((10**15 - i))

+import sys + +input = sys.stdin.readline