import sys

sys.setrecursionlimit(10 ** 7)



import numpy as np

from heapq import *



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

INF = 10 ** 15

graph = [[] for _ in range(N+1)] # graph[0]は使わない



for i in range(M):

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

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

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



def dijkstra(start, mode):

    dist = [INF] * (N+1) # dist[0]使わない

    dist[start] = 0

    que = [(0, start)]

    while que:

        d, p = heappop(que)

        # 既に安い交通費で来たことがある場合

        if dist[p] < d:

            continue

        for next_city, *fee in graph[p]:

            d1 = d + fee[mode]

            if dist[next_city] > d1:

                dist[next_city] = d1

                heappush(que, (d1, next_city))

    return dist



d1 = np.array(dijkstra(S, 0))

d2 = np.array(dijkstra(T, 1))

d1 += d2



answer = 10 ** 15 - np.minimum.accumulate(d1[::-1])[::-1][1:]

print(('\n'.join(answer.astype(str))))
import sys

from heapq import heappop, heappush

import numpy as np



stdin = sys.stdin



ri = lambda: int(rs())

rl = lambda: list(map(int, stdin.readline().split())) # applies to numbers only

rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces



N, M, S, T = rl()

graph = [[] for _ in range(N+1)] #0使わず

for _ in range(M):

    u, v, a, b = rl()

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

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



def dijkstra(start, mode):

    # 各地点への最小コストを返す

    INF = 10 ** 15

    dist = [INF] * (N+1) #0使わず

    dist[start] = 0

    que = [(0, start)]

    while que:

        d, src = heappop(que)

        if dist[src] < d:

            continue

        for next_city, *cost in graph[src]:

            d1 = d + cost[mode]

            if dist[next_city] > d1:

                dist[next_city] = d1

                heappush(que, (d1, next_city))

    return dist



d_en = np.array(dijkstra(S, 0))

d_snuke = np.array(dijkstra(T, 1))

d_cost = d_en + d_snuke

answer = 10 ** 15 - np.minimum.accumulate(d_cost[::-1])[::-1][1:]

print(('\n'.join(answer.astype(str))))

# 21
import sys

sys.setrecursionlimit(10**7)
import numpy as np
from heapq import *

N, M, S, T = list(map(int, input().split()))
INF = 10**15
graph = [[] for _ in range(N + 1)]  # graph[0]は使わない
for i in range(M):
    u, v, a, b = list(map(int, input().split()))
    graph[u].append((v, a, b))
    graph[v].append((u, a, b))


def dijkstra(start, mode):
    dist = [INF] * (N + 1)  # dist[0]使わない
    dist[start] = 0
    que = [(0, start)]
    while que:
        d, p = heappop(que)
        # 既に安い交通費で来たことがある場合
        if dist[p] < d:
            continue
        for next_city, *fee in graph[p]:
            d1 = d + fee[mode]
            if dist[next_city] > d1:
                dist[next_city] = d1
                heappush(que, (d1, next_city))
    return dist


d1 = np.array(dijkstra(S, 0))
d2 = np.array(dijkstra(T, 1))
d1 += d2
answer = 10**15 - np.minimum.accumulate(d1[::-1])[::-1][1:]
print(("\n".join(answer.astype(str))))

import sys
from heapq import heappop, heappush
import numpy as np

stdin = sys.stdin
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))  # applies to numbers only
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces
N, M, S, T = rl()
graph = [[] for _ in range(N + 1)]  # 0使わず
for _ in range(M):
    u, v, a, b = rl()
    graph[u].append((v, a, b))
    graph[v].append((u, a, b))


def dijkstra(start, mode):
    # 各地点への最小コストを返す
    INF = 10**15
    dist = [INF] * (N + 1)  # 0使わず
    dist[start] = 0
    que = [(0, start)]
    while que:
        d, src = heappop(que)
        if dist[src] < d:
            continue
        for next_city, *cost in graph[src]:
            d1 = d + cost[mode]
            if dist[next_city] > d1:
                dist[next_city] = d1
                heappush(que, (d1, next_city))
    return dist


d_en = np.array(dijkstra(S, 0))
d_snuke = np.array(dijkstra(T, 1))
d_cost = d_en + d_snuke
answer = 10**15 - np.minimum.accumulate(d_cost[::-1])[::-1][1:]
print(("\n".join(answer.astype(str))))
# 21

+from heapq import heappop, heappush +import numpy as np -sys.setrecursionlimit(10**7) -import numpy as np -from heapq import * - -N, M, S, T = list(map(int, input().split())) -INF = 10**15 -graph = [[] for _ in range(N + 1)]  # graph[0]は使わない -for i in range(M): -    u, v, a, b = list(map(int, input().split())) +stdin = sys.stdin +ri = lambda: int(rs()) +rl = lambda: list(map(int, stdin.readline().split()))  # applies to numbers only +rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces +N, M, S, T = rl() +graph = [[] for _ in range(N + 1)]  # 0使わず +for _ in range(M): +    u, v, a, b = rl() -    dist = [INF] * (N + 1)  # dist[0]使わない +    # 各地点への最小コストを返す +    INF = 10**15 +    dist = [INF] * (N + 1)  # 0使わず -        d, p = heappop(que) -        # 既に安い交通費で来たことがある場合 -        if dist[p] < d: +        d, src = heappop(que) +        if dist[src] < d: -        for next_city, *fee in graph[p]: -            d1 = d + fee[mode] +        for next_city, *cost in graph[src]: +            d1 = d + cost[mode] -d1 = np.array(dijkstra(S, 0)) -d2 = np.array(dijkstra(T, 1)) -d1 += d2 -answer = 10**15 - np.minimum.accumulate(d1[::-1])[::-1][1:] +d_en = np.array(dijkstra(S, 0)) +d_snuke = np.array(dijkstra(T, 1)) +d_cost = d_en + d_snuke +answer = 10**15 - np.minimum.accumulate(d_cost[::-1])[::-1][1:] +# 21