import sys, re

from collections import deque, defaultdict, Counter

from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians

from itertools import permutations, combinations, product

from operator import itemgetter, mul

from copy import deepcopy

from string import ascii_lowercase, ascii_uppercase, digits

from fractions import gcd

from bisect import bisect_left

from heapq import heappush, heappop

from scipy.sparse.csgraph import dijkstra



def input(): return sys.stdin.readline().strip()

def INT(): return int(eval(input()))

def MAP(): return list(map(int, input().split()))

def LIST(): return list(map(int, input().split()))

sys.setrecursionlimit(10 ** 9)

INF = float('inf')

mod = 10 ** 9 + 7



def dijkstra(E, start):

    N_d = len(E)

    dist = [INF] * N_d

    dist[start] = 0

    q = [(0, start)]

    while q:

        dist_v, v = heappop(q)

        if dist[v] != dist_v:

            continue

        for u, dist_vu in E[v]:

            dist_u = dist_v + dist_vu

            if dist_u < dist[u]:

                dist[u] = dist_u

                heappush(q, (dist_u, u))

    return dist



n, m, s, t = MAP()



uvab = [LIST() for _ in range(m)]



A = [[] for _ in range(n+1)]

B = [[] for _ in range(n+1)]



for u, v, a, b in uvab:

	A[u].append((v, a))

	A[v].append((u, a))

	B[u].append((v, b))

	B[v].append((u, b))



distA = dijkstra(A, s)  # 円での移動(s->i)

distB = dijkstra(B, t)  # スヌークでの移動(t->i)



Ans = []

init = 10**15

ans = INF

for a, b in zip(distA[:0:-1], distB[:0:-1]):

	ans = min(ans, a+b)

	Ans.append(init-ans)

Ans = Ans[::-1]

print(("\n".join(map(str, Ans))))

import sys, re

from collections import deque, defaultdict, Counter

from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians

from itertools import permutations, combinations, product

from operator import itemgetter, mul

from copy import deepcopy

from string import ascii_lowercase, ascii_uppercase, digits

from fractions import gcd

from bisect import bisect_left

from heapq import heappush, heappop

from scipy.sparse.csgraph import dijkstra



def input(): return sys.stdin.readline().strip()

def INT(): return int(eval(input()))

def MAP(): return list(map(int, input().split()))

def LIST(): return list(map(int, input().split()))

sys.setrecursionlimit(10 ** 9)

INF = float('inf')

mod = 10 ** 9 + 7



def main():

	def dijkstra(E, start):

	    N_d = len(E)

	    dist = [INF] * N_d

	    dist[start] = 0

	    q = [(0, start)]

	    while q:

	        dist_v, v = heappop(q)

	        if dist[v] != dist_v:

	            continue

	        for u, dist_vu in E[v]:

	            dist_u = dist_v + dist_vu

	            if dist_u < dist[u]:

	                dist[u] = dist_u

	                heappush(q, (dist_u, u))

	    return dist



	n, m, s, t = MAP()



	uvab = [LIST() for _ in range(m)]



	A = [[] for _ in range(n+1)]

	B = [[] for _ in range(n+1)]



	for u, v, a, b in uvab:

		A[u].append((v, a))

		A[v].append((u, a))

		B[u].append((v, b))

		B[v].append((u, b))



	distA = dijkstra(A, s)  # 円での移動(s->i)

	distB = dijkstra(B, t)  # スヌークでの移動(t->i)



	Ans = []

	init = 10**15

	ans = INF

	for a, b in zip(distA[:0:-1], distB[:0:-1]):

		ans = min(ans, a+b)

		Ans.append(init-ans)

	Ans = Ans[::-1]

	print(("\n".join(map(str, Ans))))



main()

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect_left
from heapq import heappush, heappop
from scipy.sparse.csgraph import dijkstra


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(eval(input()))


def MAP():
    return list(map(int, input().split()))


def LIST():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
INF = float("inf")
mod = 10**9 + 7


def dijkstra(E, start):
    N_d = len(E)
    dist = [INF] * N_d
    dist[start] = 0
    q = [(0, start)]
    while q:
        dist_v, v = heappop(q)
        if dist[v] != dist_v:
            continue
        for u, dist_vu in E[v]:
            dist_u = dist_v + dist_vu
            if dist_u < dist[u]:
                dist[u] = dist_u
                heappush(q, (dist_u, u))
    return dist


n, m, s, t = MAP()
uvab = [LIST() for _ in range(m)]
A = [[] for _ in range(n + 1)]
B = [[] for _ in range(n + 1)]
for u, v, a, b in uvab:
    A[u].append((v, a))
    A[v].append((u, a))
    B[u].append((v, b))
    B[v].append((u, b))
distA = dijkstra(A, s)  # 円での移動(s->i)
distB = dijkstra(B, t)  # スヌークでの移動(t->i)
Ans = []
init = 10**15
ans = INF
for a, b in zip(distA[:0:-1], distB[:0:-1]):
    ans = min(ans, a + b)
    Ans.append(init - ans)
Ans = Ans[::-1]
print(("\n".join(map(str, Ans))))

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect_left
from heapq import heappush, heappop
from scipy.sparse.csgraph import dijkstra


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(eval(input()))


def MAP():
    return list(map(int, input().split()))


def LIST():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
INF = float("inf")
mod = 10**9 + 7


def main():
    def dijkstra(E, start):
        N_d = len(E)
        dist = [INF] * N_d
        dist[start] = 0
        q = [(0, start)]
        while q:
            dist_v, v = heappop(q)
            if dist[v] != dist_v:
                continue
            for u, dist_vu in E[v]:
                dist_u = dist_v + dist_vu
                if dist_u < dist[u]:
                    dist[u] = dist_u
                    heappush(q, (dist_u, u))
        return dist

    n, m, s, t = MAP()
    uvab = [LIST() for _ in range(m)]
    A = [[] for _ in range(n + 1)]
    B = [[] for _ in range(n + 1)]
    for u, v, a, b in uvab:
        A[u].append((v, a))
        A[v].append((u, a))
        B[u].append((v, b))
        B[v].append((u, b))
    distA = dijkstra(A, s)  # 円での移動(s->i)
    distB = dijkstra(B, t)  # スヌークでの移動(t->i)
    Ans = []
    init = 10**15
    ans = INF
    for a, b in zip(distA[:0:-1], distB[:0:-1]):
        ans = min(ans, a + b)
        Ans.append(init - ans)
    Ans = Ans[::-1]
    print(("\n".join(map(str, Ans))))


main()

-def dijkstra(E, start): -    N_d = len(E) -    dist = [INF] * N_d -    dist[start] = 0 -    q = [(0, start)] -    while q: -        dist_v, v = heappop(q) -        if dist[v] != dist_v: -            continue -        for u, dist_vu in E[v]: -            dist_u = dist_v + dist_vu -            if dist_u < dist[u]: -                dist[u] = dist_u -                heappush(q, (dist_u, u)) -    return dist +def main(): +    def dijkstra(E, start): +        N_d = len(E) +        dist = [INF] * N_d +        dist[start] = 0 +        q = [(0, start)] +        while q: +            dist_v, v = heappop(q) +            if dist[v] != dist_v: +                continue +            for u, dist_vu in E[v]: +                dist_u = dist_v + dist_vu +                if dist_u < dist[u]: +                    dist[u] = dist_u +                    heappush(q, (dist_u, u)) +        return dist + +    n, m, s, t = MAP() +    uvab = [LIST() for _ in range(m)] +    A = [[] for _ in range(n + 1)] +    B = [[] for _ in range(n + 1)] +    for u, v, a, b in uvab: +        A[u].append((v, a)) +        A[v].append((u, a)) +        B[u].append((v, b)) +        B[v].append((u, b)) +    distA = dijkstra(A, s)  # 円での移動(s->i) +    distB = dijkstra(B, t)  # スヌークでの移動(t->i) +    Ans = [] +    init = 10**15 +    ans = INF +    for a, b in zip(distA[:0:-1], distB[:0:-1]): +        ans = min(ans, a + b) +        Ans.append(init - ans) +    Ans = Ans[::-1] +    print(("\n".join(map(str, Ans)))) -n, m, s, t = MAP() -uvab = [LIST() for _ in range(m)] -A = [[] for _ in range(n + 1)] -B = [[] for _ in range(n + 1)] -for u, v, a, b in uvab: -    A[u].append((v, a)) -    A[v].append((u, a)) -    B[u].append((v, b)) -    B[v].append((u, b)) -distA = dijkstra(A, s)  # 円での移動(s->i) -distB = dijkstra(B, t)  # スヌークでの移動(t->i) -Ans = [] -init = 10**15 -ans = INF -for a, b in zip(distA[:0:-1], distB[:0:-1]): -    ans = min(ans, a + b) -    Ans.append(init - ans) -Ans = Ans[::-1] -print(("\n".join(map(str, Ans)))) +main()