n,m=map(int,input().split()) edge=[[] for i in range(n)] for i in range(m): s,t,d=map(int,input().split()) s-=1;t-=1 edge[s].append((t,d*-1)) edge[t].append((s,d*-1)) from heapq import heappop,heappush def dijkstra(s,n,edge): inf=float("inf") ans=[inf]*n ans[s]=-inf root=[0]*n open=[[-inf,s]] while open: cost,node=heappop(open) if ans[node]