import sys input = sys.stdin.readline N,M=map(int,input().split()) L=[list(map(int,input().split())) for i in range(M)] LLIST=[[-1]*(N+1) for i in range(N+1)] for x,y,z in L: LLIST[x][y]=z LLIST[y][x]=z from functools import lru_cache @lru_cache(maxsize=None) def calc(USED,LAST,DIS): #print(bin(USED),LAST,DIS) ANS=DIS for i in range(1,N+1): if USED & (1<