import heapq



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

edgesYen = [[]for _ in range(n+1)]

edgesSnuuk = [[]for _ in range(n+1)]



for _ in range(m):

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

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

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

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

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





def dijkstra(edges,costDic,que):

    while que:

        cost,now = heapq.heappop(que)

        if now not in costDic:

            costDic[now] = cost

            for nx,c in edges[now]:

                if nx not in costDic:

                    heapq.heappush(que,(cost+c,nx))

#都市sから各都市に円で行く場合の最小コストを求める。

costYen = {}

que1 = [(0,s)]

heapq.heapify(que1)

dijkstra(edgesYen,costYen,que1)



costSnuuk = {}

que2 = [(0,t)]

heapq.heapify(que2)

dijkstra(edgesSnuuk,costSnuuk,que2)





minimumCosts = []

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

    cost = costYen[i] + costSnuuk[i]

    minimumCosts.append((cost,i))

heapq.heapify(minimumCosts)



money = 10**15

tmp = heapq.heappop(minimumCosts)

for i in range(n):

    while tmp[1] <= i:

        tmp = heapq.heappop(minimumCosts)

    print((money-tmp[0]))

def main():

    import sys

    input = sys.stdin.readline

    import heapq



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

    edgesYen = [[]for _ in range(n+1)]

    edgesSnuuk = [[]for _ in range(n+1)]

    for _ in range(m):

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

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

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

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

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

    

    def dijkstra(edges,costDic,startPoint):

        que=[(0,startPoint)]

        heapq.heapify(que)

        while que:

            cost,now = heapq.heappop(que)

            if now not in costDic:

                costDic[now] = cost

                for nx,c in edges[now]:

                    if nx not in costDic:

                        heapq.heappush(que,(cost+c,nx))

    costDicYen = {}

    costDicSnuuk = {}

    dijkstra(edgesYen,costDicYen,s)

    dijkstra(edgesSnuuk,costDicSnuuk,t)



    costList = []

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

        cost = costDicYen[i]+costDicSnuuk[i]

        costList.append((cost,i))

    heapq.heapify(costList)

    c,l = heapq.heappop(costList)

    for i in range(n):

        while l<=i:

            c,l = heapq.heappop(costList)

        print((10**15-c))

main()
import heapq

n, m, s, t = list(map(int, input().split()))
edgesYen = [[] for _ in range(n + 1)]
edgesSnuuk = [[] for _ in range(n + 1)]
for _ in range(m):
    u, v, a, b = list(map(int, input().split()))
    edgesYen[u].append((v, a))
    edgesYen[v].append((u, a))
    edgesSnuuk[u].append((v, b))
    edgesSnuuk[v].append((u, b))


def dijkstra(edges, costDic, que):
    while que:
        cost, now = heapq.heappop(que)
        if now not in costDic:
            costDic[now] = cost
            for nx, c in edges[now]:
                if nx not in costDic:
                    heapq.heappush(que, (cost + c, nx))


# 都市sから各都市に円で行く場合の最小コストを求める。
costYen = {}
que1 = [(0, s)]
heapq.heapify(que1)
dijkstra(edgesYen, costYen, que1)
costSnuuk = {}
que2 = [(0, t)]
heapq.heapify(que2)
dijkstra(edgesSnuuk, costSnuuk, que2)
minimumCosts = []
for i in range(1, n + 1):
    cost = costYen[i] + costSnuuk[i]
    minimumCosts.append((cost, i))
heapq.heapify(minimumCosts)
money = 10**15
tmp = heapq.heappop(minimumCosts)
for i in range(n):
    while tmp[1] <= i:
        tmp = heapq.heappop(minimumCosts)
    print((money - tmp[0]))

def main():
    import sys

    input = sys.stdin.readline
    import heapq

    n, m, s, t = list(map(int, input().split()))
    edgesYen = [[] for _ in range(n + 1)]
    edgesSnuuk = [[] for _ in range(n + 1)]
    for _ in range(m):
        u, v, a, b = list(map(int, input().split()))
        edgesYen[u].append((v, a))
        edgesSnuuk[u].append((v, b))
        edgesYen[v].append((u, a))
        edgesSnuuk[v].append((u, b))

    def dijkstra(edges, costDic, startPoint):
        que = [(0, startPoint)]
        heapq.heapify(que)
        while que:
            cost, now = heapq.heappop(que)
            if now not in costDic:
                costDic[now] = cost
                for nx, c in edges[now]:
                    if nx not in costDic:
                        heapq.heappush(que, (cost + c, nx))

    costDicYen = {}
    costDicSnuuk = {}
    dijkstra(edgesYen, costDicYen, s)
    dijkstra(edgesSnuuk, costDicSnuuk, t)
    costList = []
    for i in range(1, n + 1):
        cost = costDicYen[i] + costDicSnuuk[i]
        costList.append((cost, i))
    heapq.heapify(costList)
    c, l = heapq.heappop(costList)
    for i in range(n):
        while l <= i:
            c, l = heapq.heappop(costList)
        print((10**15 - c))


main()

-import heapq +def main(): +    import sys -n, m, s, t = list(map(int, input().split())) -edgesYen = [[] for _ in range(n + 1)] -edgesSnuuk = [[] for _ in range(n + 1)] -for _ in range(m): -    u, v, a, b = list(map(int, input().split())) -    edgesYen[u].append((v, a)) -    edgesYen[v].append((u, a)) -    edgesSnuuk[u].append((v, b)) -    edgesSnuuk[v].append((u, b)) +    input = sys.stdin.readline +    import heapq + +    n, m, s, t = list(map(int, input().split())) +    edgesYen = [[] for _ in range(n + 1)] +    edgesSnuuk = [[] for _ in range(n + 1)] +    for _ in range(m): +        u, v, a, b = list(map(int, input().split())) +        edgesYen[u].append((v, a)) +        edgesSnuuk[u].append((v, b)) +        edgesYen[v].append((u, a)) +        edgesSnuuk[v].append((u, b)) + +    def dijkstra(edges, costDic, startPoint): +        que = [(0, startPoint)] +        heapq.heapify(que) +        while que: +            cost, now = heapq.heappop(que) +            if now not in costDic: +                costDic[now] = cost +                for nx, c in edges[now]: +                    if nx not in costDic: +                        heapq.heappush(que, (cost + c, nx)) + +    costDicYen = {} +    costDicSnuuk = {} +    dijkstra(edgesYen, costDicYen, s) +    dijkstra(edgesSnuuk, costDicSnuuk, t) +    costList = [] +    for i in range(1, n + 1): +        cost = costDicYen[i] + costDicSnuuk[i] +        costList.append((cost, i)) +    heapq.heapify(costList) +    c, l = heapq.heappop(costList) +    for i in range(n): +        while l <= i: +            c, l = heapq.heappop(costList) +        print((10**15 - c)) -def dijkstra(edges, costDic, que): -    while que: -        cost, now = heapq.heappop(que) -        if now not in costDic: -            costDic[now] = cost -            for nx, c in edges[now]: -                if nx not in costDic: -                    heapq.heappush(que, (cost + c, nx)) - - -# 都市sから各都市に円で行く場合の最小コストを求める。 -costYen = {} -que1 = [(0, s)] -heapq.heapify(que1) -dijkstra(edgesYen, costYen, que1) -costSnuuk = {} -que2 = [(0, t)] -heapq.heapify(que2) -dijkstra(edgesSnuuk, costSnuuk, que2) -minimumCosts = [] -for i in range(1, n + 1): -    cost = costYen[i] + costSnuuk[i] -    minimumCosts.append((cost, i)) -heapq.heapify(minimumCosts) -money = 10**15 -tmp = heapq.heappop(minimumCosts) -for i in range(n): -    while tmp[1] <= i: -        tmp = heapq.heappop(minimumCosts) -    print((money - tmp[0])) +main()