The first line contains the number of vertices N (1≤N≤400) and the number of edges M (1≤M≤N(N−1)/2).
Each of the next M lines holds the information of one edge: the numbers of the two distinct vertices it joins, and its weight.
A vertex number is a natural number between 1 and N, and an edge weight is a natural number between 1 and 500,000,000. There is at most one edge between any two vertices.