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

a= [list(map(int, input().split())) for i in range(m)]

b = [[] for i in range(n)] # 円のグラフ

c = [[] for i in range(n)] # スヌークのグラフ



for i in range(m):

    b[a[i][0]-1].append((a[i][1]-1,a[i][2]))

    b[a[i][1]-1].append((a[i][0]-1,a[i][2]))



for i in range(m):

    c[a[i][0]-1].append((a[i][1]-1,a[i][3]))

    c[a[i][1]-1].append((a[i][0]-1,a[i][3]))



from heapq import heappush, heappop



def dijkstra(edges, size, source):

    # edge=探索するグラフ

    # size=グラフの点の数

    # source=スタート点

    distance = [float('inf')] * size

    distance[source] = 0

    visited = [False] * size

    pq = []

    heappush(pq, (0, source))

    while pq:

        dist_v, v = heappop(pq)

        visited[v] = True

        for u, weight in edges[v]:

            if not visited[u]:

                new_dist = dist_v + weight

                if distance[u] > new_dist:

                    distance[u] = new_dist

                    heappush(pq, (new_dist, u))

    return distance



x=dijkstra(b,n,s-1)

y=dijkstra(c,n,t-1)

ans=[0]*n

w=float('inf')

for i in range(n):

    v=x[n-1-i]+y[n-1-i]

    w=min(v,w)

    ans[n-1-i]=w



for i in range(n):

    print((10**15-ans[i]))
import sys

input = sys.stdin.readline





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

a= [list(map(int, input().split())) for i in range(m)]

b = [[] for i in range(n)] # 円のグラフ

c = [[] for i in range(n)] # スヌークのグラフ



for i in range(m):

    b[a[i][0]-1].append((a[i][1]-1,a[i][2]))

    b[a[i][1]-1].append((a[i][0]-1,a[i][2]))



for i in range(m):

    c[a[i][0]-1].append((a[i][1]-1,a[i][3]))

    c[a[i][1]-1].append((a[i][0]-1,a[i][3]))



from heapq import heappush, heappop



def dijkstra(edges, size, source):

    # edge=探索するグラフ

    # size=グラフの点の数

    # source=スタート点

    INF=pow(10,15)

    distance = [INF] * size

    distance[source] = 0

    visited = [False] * size

    pq = []

    heappush(pq, (0, source))

    while pq:

        dist_v, v = heappop(pq)

        visited[v] = True

        for u, weight in edges[v]:

            if not visited[u]:

                new_dist = dist_v + weight

                if distance[u] > new_dist:

                    distance[u] = new_dist

                    heappush(pq, (new_dist, u))

    return distance



x=dijkstra(b,n,s-1)

y=dijkstra(c,n,t-1)

ans=[0]*n

w=pow(10,15)

for i in range(n):

    v=x[n-1-i]+y[n-1-i]

    w=min(v,w)

    ans[n-1-i]=w



for i in range(n):

    print((pow(10,15)-ans[i]))
n, m, s, t = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(m)]
b = [[] for i in range(n)]  # 円のグラフ
c = [[] for i in range(n)]  # スヌークのグラフ
for i in range(m):
    b[a[i][0] - 1].append((a[i][1] - 1, a[i][2]))
    b[a[i][1] - 1].append((a[i][0] - 1, a[i][2]))
for i in range(m):
    c[a[i][0] - 1].append((a[i][1] - 1, a[i][3]))
    c[a[i][1] - 1].append((a[i][0] - 1, a[i][3]))
from heapq import heappush, heappop


def dijkstra(edges, size, source):
    # edge=探索するグラフ
    # size=グラフの点の数
    # source=スタート点
    distance = [float("inf")] * size
    distance[source] = 0
    visited = [False] * size
    pq = []
    heappush(pq, (0, source))
    while pq:
        dist_v, v = heappop(pq)
        visited[v] = True
        for u, weight in edges[v]:
            if not visited[u]:
                new_dist = dist_v + weight
                if distance[u] > new_dist:
                    distance[u] = new_dist
                    heappush(pq, (new_dist, u))
    return distance


x = dijkstra(b, n, s - 1)
y = dijkstra(c, n, t - 1)
ans = [0] * n
w = float("inf")
for i in range(n):
    v = x[n - 1 - i] + y[n - 1 - i]
    w = min(v, w)
    ans[n - 1 - i] = w
for i in range(n):
    print((10**15 - ans[i]))

import sys

input = sys.stdin.readline
n, m, s, t = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(m)]
b = [[] for i in range(n)]  # 円のグラフ
c = [[] for i in range(n)]  # スヌークのグラフ
for i in range(m):
    b[a[i][0] - 1].append((a[i][1] - 1, a[i][2]))
    b[a[i][1] - 1].append((a[i][0] - 1, a[i][2]))
for i in range(m):
    c[a[i][0] - 1].append((a[i][1] - 1, a[i][3]))
    c[a[i][1] - 1].append((a[i][0] - 1, a[i][3]))
from heapq import heappush, heappop


def dijkstra(edges, size, source):
    # edge=探索するグラフ
    # size=グラフの点の数
    # source=スタート点
    INF = pow(10, 15)
    distance = [INF] * size
    distance[source] = 0
    visited = [False] * size
    pq = []
    heappush(pq, (0, source))
    while pq:
        dist_v, v = heappop(pq)
        visited[v] = True
        for u, weight in edges[v]:
            if not visited[u]:
                new_dist = dist_v + weight
                if distance[u] > new_dist:
                    distance[u] = new_dist
                    heappush(pq, (new_dist, u))
    return distance


x = dijkstra(b, n, s - 1)
y = dijkstra(c, n, t - 1)
ans = [0] * n
w = pow(10, 15)
for i in range(n):
    v = x[n - 1 - i] + y[n - 1 - i]
    w = min(v, w)
    ans[n - 1 - i] = w
for i in range(n):
    print((pow(10, 15) - ans[i]))

+import sys + +input = sys.stdin.readline -    distance = [float("inf")] * size +    INF = pow(10, 15) +    distance = [INF] * size -w = float("inf") +w = pow(10, 15) -    print((10**15 - ans[i])) +    print((pow(10, 15) - ans[i]))