from heapq import heappop, heappush
from collections import defaultdict

V, E, r = map(int, input().split())
vs = defaultdict(list)
costs = 


for _ in range(E):
    s, t, d = map(int, input().split())
