import heapq N,M,S,G = map(int,input().split()) F = {i:[] for i in range(N)} for _ in range(M): a,b,c = map(int,input().split()) F[a].append((b,c)) F[b].append((a,c)) INFTY = 10**7 dist = [INFTY]*N visited = [False]*N Pa = [-1]*N dist[S] = 0 heap = [(0,S)] while heap: d,u = heapq.heappop(heap) if dist[u]d+c: dist[v] = d+c Pa[v] = u heapq.heappush(heap,(d+c,v)) elif dist[v]==d+c: u1 = Pa[v] if u