from heapq import heappush, heappop



money = 10**15

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

s -= 1; t -= 1

graph = [[[] for i in range(N)] for _ in range(2)]

for i in range(M):

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

  u -= 1; v -= 1

  graph[0][u].append((v, a)); graph[0][v].append((u, a))

  graph[1][u].append((v, b)); graph[1][v].append((u, b))





def dijkstra(s, mode):

  dist = [-1] * N

  dist[s] = 0

  e = []

  for child, cost in graph[mode][s]:

    heappush(e, (cost, child))

  while e:

    cost, node = heappop(e)

    if dist[node] >= 0:

      continue

    dist[node] = cost

    for child, c in graph[mode][node]:

      if dist[child] >= 0:

        continue

      heappush(e, (cost+c, child))

  return dist

  

dist = [dijkstra(s, 0), dijkstra(t, 1)]  

value = [dist[0][i]+dist[1][i] for i in range(N)]



ans = []

cost = []

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

  heappush(cost, value[i])

  ans.append(money - cost[0])



print(*(ans[::-1]), sep='\n')

from heapq import heappush, heappop

import sys

input = sys.stdin.readline



money = 10**15

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

s -= 1; t -= 1

graph = [[[] for i in range(N)] for _ in range(2)]

for i in range(M):

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

  u -= 1; v -= 1

  graph[0][u].append((v, a)); graph[0][v].append((u, a))

  graph[1][u].append((v, b)); graph[1][v].append((u, b))





def dijkstra(s, mode):

  dist = [-1] * N

  dist[s] = 0

  e = []

  for child, cost in graph[mode][s]:

    heappush(e, (cost, child))

  while e:

    cost, node = heappop(e)

    if dist[node] >= 0:

      continue

    dist[node] = cost

    for child, c in graph[mode][node]:

      if dist[child] >= 0:

        continue

      heappush(e, (cost+c, child))

  return dist

  

dist = [dijkstra(s, 0), dijkstra(t, 1)]  

value = [dist[0][i]+dist[1][i] for i in range(N)]



ans = []

cost = []

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

  heappush(cost, value[i])

  ans.append(money - cost[0])



print(*(ans[::-1]), sep='\n')

from heapq import heappush, heappop

money = 10**15
N, M, s, t = map(int, input().split())
s -= 1
t -= 1
graph = [[[] for i in range(N)] for _ in range(2)]
for i in range(M):
    u, v, a, b = map(int, input().split())
    u -= 1
    v -= 1
    graph[0][u].append((v, a))
    graph[0][v].append((u, a))
    graph[1][u].append((v, b))
    graph[1][v].append((u, b))


def dijkstra(s, mode):
    dist = [-1] * N
    dist[s] = 0
    e = []
    for child, cost in graph[mode][s]:
        heappush(e, (cost, child))
    while e:
        cost, node = heappop(e)
        if dist[node] >= 0:
            continue
        dist[node] = cost
        for child, c in graph[mode][node]:
            if dist[child] >= 0:
                continue
            heappush(e, (cost + c, child))
    return dist


dist = [dijkstra(s, 0), dijkstra(t, 1)]
value = [dist[0][i] + dist[1][i] for i in range(N)]
ans = []
cost = []
for i in range(N - 1, -1, -1):
    heappush(cost, value[i])
    ans.append(money - cost[0])
print(*(ans[::-1]), sep="\n")

from heapq import heappush, heappop
import sys

input = sys.stdin.readline
money = 10**15
N, M, s, t = map(int, input().split())
s -= 1
t -= 1
graph = [[[] for i in range(N)] for _ in range(2)]
for i in range(M):
    u, v, a, b = map(int, input().split())
    u -= 1
    v -= 1
    graph[0][u].append((v, a))
    graph[0][v].append((u, a))
    graph[1][u].append((v, b))
    graph[1][v].append((u, b))


def dijkstra(s, mode):
    dist = [-1] * N
    dist[s] = 0
    e = []
    for child, cost in graph[mode][s]:
        heappush(e, (cost, child))
    while e:
        cost, node = heappop(e)
        if dist[node] >= 0:
            continue
        dist[node] = cost
        for child, c in graph[mode][node]:
            if dist[child] >= 0:
                continue
            heappush(e, (cost + c, child))
    return dist


dist = [dijkstra(s, 0), dijkstra(t, 1)]
value = [dist[0][i] + dist[1][i] for i in range(N)]
ans = []
cost = []
for i in range(N - 1, -1, -1):
    heappush(cost, value[i])
    ans.append(money - cost[0])
print(*(ans[::-1]), sep="\n")

+import sys +input = sys.stdin.readline