import sys

input=sys.stdin.readline

from collections import defaultdict

from heapq import heappush,heappop

from itertools import accumulate

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

en=defaultdict(set)

sneek=defaultdict(set)

for i in range(m):

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

    en[u]|={(a,v)}

    en[v]|={(a,u)}

    sneek[u]|={(b,v)}

    sneek[v]|={(b,u)}

inf=float('inf')

def makedist(first,branch):

    dist=[inf]*(N+1)

    dist[first]=0

    check=[(0,first)]

    while len(check)>0:

        d,now=heappop(check)

        if dist[now]<d:

            continue

        for lenth,nex in branch[now]:

            if d+lenth<dist[nex]:

                dist[nex]=d+lenth

                heappush(check,(d+lenth,nex))

    return dist

disten=makedist(s,en)

distsneek=makedist(t,sneek)

ans=list(accumulate([y+s for y,s in zip(disten,distsneek)][::-1],min))

big=10**15

for i in range(N-1,-1,-1):

    print((big-ans[i]))

#https://atcoder.jp/contests/soundhound2018-summer-qual/submissions/4993088
import sys

input=sys.stdin.readline

from collections import defaultdict

from heapq import heappush,heappop

from itertools import accumulate

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

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

sneek=[set() for i in range(N+1)]

for i in range(m):

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

    en[u]|={(a,v)}

    en[v]|={(a,u)}

    sneek[u]|={(b,v)}

    sneek[v]|={(b,u)}

inf=float('inf')

def makedist(first,branch):

    dist=[inf]*(N+1)

    dist[first]=0

    check=[(0,first)]

    while len(check)>0:

        d,now=heappop(check)

        if dist[now]<d:

            continue

        for lenth,nex in branch[now]:

            if d+lenth<dist[nex]:

                dist[nex]=d+lenth

                heappush(check,(d+lenth,nex))

    return dist

disten=makedist(s,en)

distsneek=makedist(t,sneek)

ans=list(accumulate([y+s for y,s in zip(disten,distsneek)][::-1],min))

big=10**15

[print(big-ans[i]) for i in range(N-1,-1,-1)]

#https://atcoder.jp/contests/soundhound2018-summer-qual/submissions/4993088

import sys

input = sys.stdin.readline
from collections import defaultdict
from heapq import heappush, heappop
from itertools import accumulate

N, m, s, t = list(map(int, input().split()))
en = defaultdict(set)
sneek = defaultdict(set)
for i in range(m):
    u, v, a, b = list(map(int, input().split()))
    en[u] |= {(a, v)}
    en[v] |= {(a, u)}
    sneek[u] |= {(b, v)}
    sneek[v] |= {(b, u)}
inf = float("inf")


def makedist(first, branch):
    dist = [inf] * (N + 1)
    dist[first] = 0
    check = [(0, first)]
    while len(check) > 0:
        d, now = heappop(check)
        if dist[now] < d:
            continue
        for lenth, nex in branch[now]:
            if d + lenth < dist[nex]:
                dist[nex] = d + lenth
                heappush(check, (d + lenth, nex))
    return dist


disten = makedist(s, en)
distsneek = makedist(t, sneek)
ans = list(accumulate([y + s for y, s in zip(disten, distsneek)][::-1], min))
big = 10**15
for i in range(N - 1, -1, -1):
    print((big - ans[i]))
# https://atcoder.jp/contests/soundhound2018-summer-qual/submissions/4993088

import sys

input = sys.stdin.readline
from collections import defaultdict
from heapq import heappush, heappop
from itertools import accumulate

N, m, s, t = map(int, input().split())
en = [set() for i in range(N + 1)]
sneek = [set() for i in range(N + 1)]
for i in range(m):
    u, v, a, b = map(int, input().split())
    en[u] |= {(a, v)}
    en[v] |= {(a, u)}
    sneek[u] |= {(b, v)}
    sneek[v] |= {(b, u)}
inf = float("inf")


def makedist(first, branch):
    dist = [inf] * (N + 1)
    dist[first] = 0
    check = [(0, first)]
    while len(check) > 0:
        d, now = heappop(check)
        if dist[now] < d:
            continue
        for lenth, nex in branch[now]:
            if d + lenth < dist[nex]:
                dist[nex] = d + lenth
                heappush(check, (d + lenth, nex))
    return dist


disten = makedist(s, en)
distsneek = makedist(t, sneek)
ans = list(accumulate([y + s for y, s in zip(disten, distsneek)][::-1], min))
big = 10**15
[print(big - ans[i]) for i in range(N - 1, -1, -1)]
# https://atcoder.jp/contests/soundhound2018-summer-qual/submissions/4993088

-N, m, s, t = list(map(int, input().split())) -en = defaultdict(set) -sneek = defaultdict(set) +N, m, s, t = map(int, input().split()) +en = [set() for i in range(N + 1)] +sneek = [set() for i in range(N + 1)] -    u, v, a, b = list(map(int, input().split())) +    u, v, a, b = map(int, input().split()) -for i in range(N - 1, -1, -1): -    print((big - ans[i])) +[print(big - ans[i]) for i in range(N - 1, -1, -1)]