### BUGGY CODE ###

# coding: utf-8
# Your code here!

import heapq
dif = 10 ** 5

n, m, s, t  = list(map(int, input().split()))
links_en = [[-1 for j in range(n)] for i in range(n)]
links_sn = [[-1 for j in range(n)] for i in range(n)]

for i in range(m):
    u, v, a, b  = list(map(int, input().split()))
    links_en[u - 1][v - 1] = a
    links_en[v - 1][u - 1] = a
    links_sn[v - 1][u - 1] = b
    links_sn[u - 1][v - 1] = b

s -= 1
t -= 1

cost_en_from_s = [10 ** 20] * n
cost_sn_to_t = [10 ** 20] * n

path_en = [-1] * n
path_sn = [-1] * n

cost_en_from_s[s] = 0
node_list = []
serched_node = set()
heapq.heappush(node_list, s)
while(node_list != []):
    index = heapq.heappop(node_list) % dif
    serched_node.add(index)
    link = links_en[index]
    for j in range(n):
        if j in serched_node:
            continue
    
        cost = link[j]
        if cost == -1:
            continue
    
        newcost =  cost_en_from_s[index] + cost
        if newcost < cost_en_from_s[j]:
            cost_en_from_s[j] = newcost
            heapq.heappush(node_list, newcost * dif + j)
            path_en[j] = index    


cost_sn_to_t[t] = 0
node_list = []
serched_node = set()
heapq.heappush(node_list, t)
while(node_list != []):
    index = heapq.heappop(node_list) % dif
    serched_node.add(index)
    link = links_sn[index]
    for j in range(n):
        if j in serched_node:
            continue
    
        cost = link[j]
        if cost == -1:
            continue
    
        newcost =  cost_sn_to_t[index] + cost
        if newcost < cost_sn_to_t[j]:
            cost_sn_to_t[j] = newcost
            heapq.heappush(node_list, newcost * dif + j)
            path_sn[j] = index 
    
trans = n - 1
costs = [0] * n
for i in range(n - 1, -1, -1):
    if i == n - 1:
        costs[n-1] = cost_en_from_s[n-1] + cost_sn_to_t[n-1]
        continue
    
    newcost = cost_en_from_s[i] + cost_sn_to_t[i]
    if newcost < costs[trans]:
        trans = i
        costs[i] = newcost
        continue
    
    costs[i] = costs[trans]
    
for cost in costs:
    print(10**15 - cost)

### FIXED CODE ###

import heapq
initial_cost = 10 ** 9
initial = 10 ** 15

def di(link_costs, s):
    costs = [initial] * n
    costs[s] = 0
    q = []
    heapq.heappush(q, (0, s))
    
    while(len(q) != 0):
        index_cost, index = heapq.heappop(q)
        if costs[index] < index_cost:
            continue

        for j in link_costs[index]:
            newcost = costs[index] + link_costs[index][j]
            if newcost < costs[j]:
                costs[j] = newcost
                heapq.heappush(q, (newcost, j))
    return costs
    
n, m, s, t  = list(map(int, input().split()))
s -= 1
t -= 1
links_cost_en = [{} for _ in range(n)]
links_cost_sn = [{} for _ in range(n)]

for _ in range(m):
    u, v, a, b  = list(map(int, input().split()))
    u -= 1
    v -= 1
    links_cost_en[u][v] = a
    links_cost_en[v][u] = a
    links_cost_sn[u][v] = b
    links_cost_sn[v][u] = b

cost_en_from_s = di(links_cost_en, s)
cost_sn_to_t = di(links_cost_sn, t)
cost_list = [cost_en_from_s[i] + cost_sn_to_t[i] for i in range(n)]

ans = [initial] * n
ans[-1] = cost_list[-1]
for i in list(range(n - 1))[::-1]:
    ans[i] = min(ans[i + 1], cost_list[i])
for i in range(n):
    print(initial - ans[i])