from collections import defaultdict

from itertools import accumulate

import heapq

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

s-=1

t-=1

yen={}

snk={}

adj=defaultdict(list)

for _ in range(m):

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

    u-=1    

    v-=1    

    adj[u].append(v)

    adj[v].append(u)

    yen[u,v]=a

    yen[v,u]=a

    snk[u,v]=b

    snk[v,u]=b

 

def dijkstra(s, t, cost):

    q=[]

    d=[float('inf')]*n

    d[s]=0

    heapq.heappush(q, (d[s], s))

    while q!=[]:

        du, u=heapq.heappop(q)

        if du>d[u]:

            continue

        for v in adj[u]:

            if d[v]>du+cost[u,v]:

                d[v]=du+cost[u,v]

                heapq.heappush(q, (d[v], v))

    return d

 

d1=dijkstra(s, t, yen)

d2=dijkstra(t, s, snk)

ans=list(accumulate(reversed([y+s for y,s in zip(d1, d2)]), min))

for ai in reversed(ans):

    print((10**15-ai))

from itertools import accumulate

import heapq

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

s-=1

t-=1

yen=[{} for _ in range(n)]

snk=[{} for _ in range(n)]

for _ in range(m):

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

    u-=1    

    v-=1    

    yen[u][v]=a

    yen[v][u]=a

    snk[u][v]=b

    snk[v][u]=b

 

def dijkstra(s, t, g):

    q=[]

    d=[float('inf')]*n

    d[s]=0

    heapq.heappush(q, (d[s], s))

    while q!=[]:

        du, u=heapq.heappop(q)

        if du>d[u]:

            continue

        for v in g[u]:

            if d[v]>du+g[u][v]:

                d[v]=du+g[u][v]

                heapq.heappush(q, (d[v], v))

    return d

 

d1=dijkstra(s, t, yen)

d2=dijkstra(t, s, snk)

ans=list(accumulate(reversed([y+s for y,s in zip(d1, d2)]), min))

for ai in reversed(ans):

    print((10**15-ai))

from collections import defaultdict
from itertools import accumulate
import heapq

n, m, s, t = list(map(int, input().split()))
s -= 1
t -= 1
yen = {}
snk = {}
adj = defaultdict(list)
for _ in range(m):
    u, v, a, b = list(map(int, input().split()))
    u -= 1
    v -= 1
    adj[u].append(v)
    adj[v].append(u)
    yen[u, v] = a
    yen[v, u] = a
    snk[u, v] = b
    snk[v, u] = b


def dijkstra(s, t, cost):
    q = []
    d = [float("inf")] * n
    d[s] = 0
    heapq.heappush(q, (d[s], s))
    while q != []:
        du, u = heapq.heappop(q)
        if du > d[u]:
            continue
        for v in adj[u]:
            if d[v] > du + cost[u, v]:
                d[v] = du + cost[u, v]
                heapq.heappush(q, (d[v], v))
    return d


d1 = dijkstra(s, t, yen)
d2 = dijkstra(t, s, snk)
ans = list(accumulate(reversed([y + s for y, s in zip(d1, d2)]), min))
for ai in reversed(ans):
    print((10**15 - ai))

from itertools import accumulate
import heapq

n, m, s, t = list(map(int, input().split()))
s -= 1
t -= 1
yen = [{} for _ in range(n)]
snk = [{} for _ in range(n)]
for _ in range(m):
    u, v, a, b = list(map(int, input().split()))
    u -= 1
    v -= 1
    yen[u][v] = a
    yen[v][u] = a
    snk[u][v] = b
    snk[v][u] = b


def dijkstra(s, t, g):
    q = []
    d = [float("inf")] * n
    d[s] = 0
    heapq.heappush(q, (d[s], s))
    while q != []:
        du, u = heapq.heappop(q)
        if du > d[u]:
            continue
        for v in g[u]:
            if d[v] > du + g[u][v]:
                d[v] = du + g[u][v]
                heapq.heappush(q, (d[v], v))
    return d


d1 = dijkstra(s, t, yen)
d2 = dijkstra(t, s, snk)
ans = list(accumulate(reversed([y + s for y, s in zip(d1, d2)]), min))
for ai in reversed(ans):
    print((10**15 - ai))

-from collections import defaultdict -yen = {} -snk = {} -adj = defaultdict(list) +yen = [{} for _ in range(n)] +snk = [{} for _ in range(n)] -    adj[u].append(v) -    adj[v].append(u) -    yen[u, v] = a -    yen[v, u] = a -    snk[u, v] = b -    snk[v, u] = b +    yen[u][v] = a +    yen[v][u] = a +    snk[u][v] = b +    snk[v][u] = b -def dijkstra(s, t, cost): +def dijkstra(s, t, g): -        for v in adj[u]: -            if d[v] > du + cost[u, v]: -                d[v] = du + cost[u, v] +        for v in g[u]: +            if d[v] > du + g[u][v]: +                d[v] = du + g[u][v]