N,M = map(int,input().split()) scores = [[0]*N for _ in range(N)] for _ in range(M): i,j,score = map(int,input().split()) scores[i][j] = score scores[j][i] = 0 dp = [[0]*N for _ in range(1<