Buggy python submission (verdict: Time Limit Exceeded):
import networkx as nx

MAX = 10 ** 15
N, M, S, T = map(int, input().split())

G = nx.Graph()
G.add_nodes_from(range(1, N + 1))
for _ in range(M):
    u, v, a, b = map(int, input().split())
    G.add_edge(u, v, yen=a, snuuk=b)

yen_path = nx.single_source_dijkstra_path_length(G, S, weight='yen')
snuuk_path = nx.single_source_dijkstra_path_length(G, T, weight='snuuk')

ans = [MAX] * (N + 1)
for i in range(N, 0, -1):
    ans[i - 1] = min(ans[i], yen_path[i] + snuuk_path[i])
for x in ans[:N]:
    print(MAX - x)


Fixed submission:
import sys
import networkx as nx

input = sys.stdin.buffer.readline

MAX = 10 ** 15
N, M, S, T = map(int, input().split())

G = nx.Graph()
G.add_nodes_from(range(1, N + 1))
for _ in range(M):
    u, v, a, b = map(int, input().split())
    G.add_edge(u, v, yen=a, snuuk=b)

yen_path = nx.single_source_dijkstra_path_length(G, S, weight='yen')
snuuk_path = nx.single_source_dijkstra_path_length(G, T, weight='snuuk')

ans = [MAX] * (N + 1)
for i in range(N, 0, -1):
    ans[i - 1] = min(ans[i], yen_path[i] + snuuk_path[i])
for x in ans[:N]:
    print(MAX - x)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np
from scipy.sparse.csgraph import dijkstra
from scipy.sparse import csr_matrix

input = sys.stdin.buffer.readline

N, M, S, T = map(int, input().split())
S -= 1
T -= 1
UVAB = np.array([tuple(map(int, input().split())) for _ in range(M)]).T
UVAB[:2] -= 1

yen_matrix = csr_matrix((UVAB[2], (UVAB[0], UVAB[1])), shape=(N, N))
yen_path = dijkstra(yen_matrix, indices=S, directed=False).astype(int)

snuuk_matrix = csr_matrix((UVAB[3], (UVAB[0], UVAB[1])), shape=(N, N))
snuuk_path = dijkstra(snuuk_matrix, indices=T, directed=False).astype(int)

path = yen_path + snuuk_path
path_acc = np.minimum.accumulate(path[::-1])[::-1]
print(*(10 ** 15 - path_acc), sep='\n')


Fixed submission:
import sys
import networkx as nx

input = sys.stdin.buffer.readline

MAX = 10 ** 15
N, M, S, T = map(int, input().split())

G = nx.Graph()
G.add_nodes_from(range(1, N + 1))
for _ in range(M):
    u, v, a, b = map(int, input().split())
    G.add_edge(u, v, yen=a, snuuk=b)

yen_path = nx.single_source_dijkstra_path_length(G, S, weight='yen')
snuuk_path = nx.single_source_dijkstra_path_length(G, T, weight='snuuk')

ans = [MAX] * (N + 1)
for i in range(N, 0, -1):
    ans[i - 1] = min(ans[i], yen_path[i] + snuuk_path[i])
for x in ans[:N]:
    print(MAX - x)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np
from scipy.sparse.csgraph import dijkstra
from scipy.sparse import csr_matrix

input = sys.stdin.buffer.readline

N, M, S, T = map(int, input().split())
S -= 1
T -= 1
UVAB = np.array([tuple(map(int, input().split())) for _ in range(M)])
UVAB[:, :2] -= 1

yen_matrix = csr_matrix((UVAB[:, 2], (UVAB[:, 0], UVAB[:, 1])), shape=(N, N))
yen_path = dijkstra(yen_matrix, indices=S, directed=False).astype(int)

snuke_matrix = csr_matrix((UVAB[:, 3], (UVAB[:, 0], UVAB[:, 1])), shape=(N, N))
snuke_path = dijkstra(snuke_matrix, indices=T, directed=False).astype(int)

path = yen_path + snuke_path
path_acc = np.minimum.accumulate(path[::-1])[::-1]
print(*(10 ** 15 - path_acc), sep='\n')


Fixed submission:
import sys
import networkx as nx

input = sys.stdin.buffer.readline

MAX = 10 ** 15
N, M, S, T = map(int, input().split())

G = nx.Graph()
G.add_nodes_from(range(1, N + 1))
for _ in range(M):
    u, v, a, b = map(int, input().split())
    G.add_edge(u, v, yen=a, snuuk=b)

yen_path = nx.single_source_dijkstra_path_length(G, S, weight='yen')
snuuk_path = nx.single_source_dijkstra_path_length(G, T, weight='snuuk')

ans = [MAX] * (N + 1)
for i in range(N, 0, -1):
    ans[i - 1] = min(ans[i], yen_path[i] + snuuk_path[i])
for x in ans[:N]:
    print(MAX - x)