import sys

input = sys.stdin.readline

sys.setrecursionlimit(10 ** 7)



import numpy as np

from heapq import heappush, heappop



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

graph = [[] for _ in range(N+1)]

for _ in range(M):

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

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

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



def dijkstra(start, mode):

    INF = 10 ** 15

    dist = [INF] * (N+1)

    dist[start] = 0

    q = [(0,start)]

    while q:

        d,v = heappop(q)

        if dist[v] < d:

            continue

        for w,*a in graph[v]:

            d1 = d + a[mode]

            if dist[w] > d1:

                dist[w] = d1

                heappush(q, (d1,w))

    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(*answer, sep='\n')

import sys

input = sys.stdin.readline

sys.setrecursionlimit(10 ** 7)



import numpy as np

from heapq import heappush, heappop



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

graph = [[] for _ in range(N+1)]

for _ 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):

    INF = 10 ** 15

    dist = [INF] * (N+1)

    dist[start] = 0

    q = [(0,start)]

    while q:

        d,v = heappop(q)

        if dist[v] < d:

            continue

        for w,*a in graph[v]:

            d1 = d + a[mode]

            if dist[w] > d1:

                dist[w] = d1

                heappush(q, (d1,w))

    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

input = sys.stdin.readline
sys.setrecursionlimit(10**7)
import numpy as np
from heapq import heappush, heappop

N, M, S, T = map(int, input().split())
graph = [[] for _ in range(N + 1)]
for _ in range(M):
    u, v, a, b = map(int, input().split())
    graph[u].append((v, a, b))
    graph[v].append((u, a, b))


def dijkstra(start, mode):
    INF = 10**15
    dist = [INF] * (N + 1)
    dist[start] = 0
    q = [(0, start)]
    while q:
        d, v = heappop(q)
        if dist[v] < d:
            continue
        for w, *a in graph[v]:
            d1 = d + a[mode]
            if dist[w] > d1:
                dist[w] = d1
                heappush(q, (d1, w))
    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(*answer, sep="\n")

import sys

input = sys.stdin.readline
sys.setrecursionlimit(10**7)
import numpy as np
from heapq import heappush, heappop

N, M, S, T = list(map(int, input().split()))
graph = [[] for _ in range(N + 1)]
for _ 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):
    INF = 10**15
    dist = [INF] * (N + 1)
    dist[start] = 0
    q = [(0, start)]
    while q:
        d, v = heappop(q)
        if dist[v] < d:
            continue
        for w, *a in graph[v]:
            d1 = d + a[mode]
            if dist[w] > d1:
                dist[w] = d1
                heappush(q, (d1, w))
    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))))

-N, M, S, T = map(int, input().split()) +N, M, S, T = list(map(int, input().split())) -    u, v, a, b = map(int, input().split()) +    u, v, a, b = list(map(int, input().split())) -print(*answer, sep="\n") +print(("\n".join(answer.astype(str))))