Buggy python submission (verdict: Runtime Error):
from scipy.sparse.csgraph import dijkstra
n,m,s,t=map(int,input().split())

E=[[10**15 for j in range(n+1)]for i in range(n+1)]
S=[[10**15 for j in range(n+1)]for i in range(n+1)]

for i in range(m):
    x,y,a,b=map(int,input().split())
    E[x][y]=a
    E[y][x]=a
    S[x][y]=b
    S[y][x]=b
    
#print(E)
#print(S)
E=dijkstra(E,indices = s)
S=dijkstra(S,indices = t)
#print(E)
#print(S)

Q=[]
for i in range(1,n+1):
    Q.append((int(E[i]+S[i]),i))

Q.sort()
cnt=0
for i in range(1,n+1):
    while Q[cnt][1]<i:
        cnt+=1
    print(10**15-Q[cnt][0])
#print(Q)

Fixed submission:
n,m,s,t=map(int,input().split())

en=[[]for i in range(n+1)]
sn=[[]for i in range(n+1)]

for i in range(m):
    u,v,a,b=map(int,input().split())
    en[v].append((u,a))
    en[u].append((v,a))
    sn[v].append((u,b))
    sn[u].append((v,b))
#print(en)

import numpy as np
INF=10**20

def dijkstra(S, N, paths):
    from heapq import heappush,heappop
    q=[(0,S)]
    shortest=[INF]*N
    shortest[S]=0
    while len(q)>0:
        d0, src=heappop(q)
        if d0>shortest[src]:
            continue
        for dst, d1 in paths[src]:
            if d0+d1<shortest[dst]:
                shortest[dst]=d0+d1
                heappush(q, (d0+d1, dst))
    return np.array(shortest)
    
en=dijkstra(s,n+1,en)
sn=dijkstra(t,n+1,sn)

cost=[]
for i in range(1,n+1):
    cost.append(en[i]+sn[i])
cost=cost[::-1]
#print(cost)

ans=[]
mi=cost[0]
for i in range(n):
    ans.append(min(mi,cost[i]))
    mi=min(mi,cost[i])
ans=ans[::-1]
#print(ans)
for i in ans:
    print(10**15-i)

Buggy python submission (verdict: Runtime Error):
from scipy.sparse.csgraph import dijkstra
n,m,s,t=map(int,input().split())

E=[[10**15 for j in range(n+1)]for i in range(n+1)]
S=[[10**15 for j in range(n+1)]for i in range(n+1)]

for i in range(m):
    x,y,a,b=map(int,input().split())
    E[x][y]=a
    E[y][x]=a
    S[x][y]=b
    S[y][x]=b
    
#print(E)
#print(S)
E=dijkstra(E,indices = s)
S=dijkstra(S,indices = t)
#print(E)
#print(S)

Q=[]
for i in range(1,n+1):
    Q.append((int(E[i]+S[i]),i))

import heapq
heapq.heapify(Q)
for i in range(1,n+1):
    while Q[0][1]<i:
        heapq.heappop(Q)
    print(10**15-Q[0][0])


Fixed submission:
n,m,s,t=map(int,input().split())

en=[[]for i in range(n+1)]
sn=[[]for i in range(n+1)]

for i in range(m):
    u,v,a,b=map(int,input().split())
    en[v].append((u,a))
    en[u].append((v,a))
    sn[v].append((u,b))
    sn[u].append((v,b))
#print(en)

import numpy as np
INF=10**20

def dijkstra(S, N, paths):
    from heapq import heappush,heappop
    q=[(0,S)]
    shortest=[INF]*N
    shortest[S]=0
    while len(q)>0:
        d0, src=heappop(q)
        if d0>shortest[src]:
            continue
        for dst, d1 in paths[src]:
            if d0+d1<shortest[dst]:
                shortest[dst]=d0+d1
                heappush(q, (d0+d1, dst))
    return np.array(shortest)
    
en=dijkstra(s,n+1,en)
sn=dijkstra(t,n+1,sn)

cost=[]
for i in range(1,n+1):
    cost.append(en[i]+sn[i])
cost=cost[::-1]
#print(cost)

ans=[]
mi=cost[0]
for i in range(n):
    ans.append(min(mi,cost[i]))
    mi=min(mi,cost[i])
ans=ans[::-1]
#print(ans)
for i in ans:
    print(10**15-i)