N,M,S,T = map(int,input().split())

S,T = S-1,T-1

UVAB = [tuple(map(int,input().split())) for i in range(M)]

es = [[] for _ in range(N)]

for u,v,a,b in UVAB:

    u,v = u-1,v-1

    es[u].append((v,a,b))

    es[v].append((u,a,b))



import heapq

INF = float('inf')

cy = [INF] * N

cy[S] = 0

hq = [(0,S)]

heapq.heapify(hq)

while hq:

    c,v = heapq.heappop(hq)

    for to,a,_ in es[v]:

        if c+a >= cy[to]: continue

        cy[to] = c+a

        heapq.heappush(hq, (c+a, to))

cs = [INF] * N

cs[T] = 0

hq = [(0,T)]

heapq.heapify(hq)

while hq:

    c,v = heapq.heappop(hq)

    for to,_,b in es[v]:

        if c+b >= cs[to]: continue

        cs[to] = c+b

        heapq.heappush(hq, (c+b, to))



ans = [-1] * N

minc = INF

for i,(y,s) in reversed(list(enumerate(zip(cy,cs)))):

    minc = min(minc, y+s)

    ans[i] = 10**15 - minc

print(*ans, sep='\n')

import sys

input = sys.stdin.readline

N,M,S,T = map(int,input().split())

S,T = S-1,T-1

UVAB = [tuple(map(int,input().split())) for i in range(M)]



es = [[] for _ in range(N)]

for u,v,a,b in UVAB:

    u,v = u-1,v-1

    es[u].append((v,a,b))

    es[v].append((u,a,b))



import heapq

INF = float('inf')

costy = [INF] * N

costy[S] = 0

hq = [(0,S)]

while hq:

    c,v = heapq.heappop(hq)

    for to,a,_ in es[v]:

        if costy[to] <= c+a: continue

        costy[to] = c+a

        heapq.heappush(hq, (c+a,to))



costs = [INF] * N

costs[T] = 0

hq = [(0,T)]

while hq:

    c,v = heapq.heappop(hq)

    for to,_,b in es[v]:

        if costs[to] <= c+b: continue

        costs[to] = c+b

        heapq.heappush(hq, (c+b,to))



ans = [0]

for y,s in reversed(list(zip(costy,costs))):

    ans.append(max(ans[-1], 10**15 - y - s))



print(*ans[1:][::-1], sep='\n')

N, M, S, T = map(int, input().split())
S, T = S - 1, T - 1
UVAB = [tuple(map(int, input().split())) for i in range(M)]
es = [[] for _ in range(N)]
for u, v, a, b in UVAB:
    u, v = u - 1, v - 1
    es[u].append((v, a, b))
    es[v].append((u, a, b))
import heapq

INF = float("inf")
cy = [INF] * N
cy[S] = 0
hq = [(0, S)]
heapq.heapify(hq)
while hq:
    c, v = heapq.heappop(hq)
    for to, a, _ in es[v]:
        if c + a >= cy[to]:
            continue
        cy[to] = c + a
        heapq.heappush(hq, (c + a, to))
cs = [INF] * N
cs[T] = 0
hq = [(0, T)]
heapq.heapify(hq)
while hq:
    c, v = heapq.heappop(hq)
    for to, _, b in es[v]:
        if c + b >= cs[to]:
            continue
        cs[to] = c + b
        heapq.heappush(hq, (c + b, to))
ans = [-1] * N
minc = INF
for i, (y, s) in reversed(list(enumerate(zip(cy, cs)))):
    minc = min(minc, y + s)
    ans[i] = 10**15 - minc
print(*ans, sep="\n")

import sys

input = sys.stdin.readline
N, M, S, T = map(int, input().split())
S, T = S - 1, T - 1
UVAB = [tuple(map(int, input().split())) for i in range(M)]
es = [[] for _ in range(N)]
for u, v, a, b in UVAB:
    u, v = u - 1, v - 1
    es[u].append((v, a, b))
    es[v].append((u, a, b))
import heapq

INF = float("inf")
costy = [INF] * N
costy[S] = 0
hq = [(0, S)]
while hq:
    c, v = heapq.heappop(hq)
    for to, a, _ in es[v]:
        if costy[to] <= c + a:
            continue
        costy[to] = c + a
        heapq.heappush(hq, (c + a, to))
costs = [INF] * N
costs[T] = 0
hq = [(0, T)]
while hq:
    c, v = heapq.heappop(hq)
    for to, _, b in es[v]:
        if costs[to] <= c + b:
            continue
        costs[to] = c + b
        heapq.heappush(hq, (c + b, to))
ans = [0]
for y, s in reversed(list(zip(costy, costs))):
    ans.append(max(ans[-1], 10**15 - y - s))
print(*ans[1:][::-1], sep="\n")

+import sys + +input = sys.stdin.readline -cy = [INF] * N -cy[S] = 0 +costy = [INF] * N +costy[S] = 0 -heapq.heapify(hq) -        if c + a >= cy[to]: +        if costy[to] <= c + a: -        cy[to] = c + a +        costy[to] = c + a -cs = [INF] * N -cs[T] = 0 +costs = [INF] * N +costs[T] = 0 -heapq.heapify(hq) -        if c + b >= cs[to]: +        if costs[to] <= c + b: -        cs[to] = c + b +        costs[to] = c + b -ans = [-1] * N -minc = INF -for i, (y, s) in reversed(list(enumerate(zip(cy, cs)))): -    minc = min(minc, y + s) -    ans[i] = 10**15 - minc -print(*ans, sep="\n") +ans = [0] +for y, s in reversed(list(zip(costy, costs))): +    ans.append(max(ans[-1], 10**15 - y - s)) +print(*ans[1:][::-1], sep="\n")