Introduction - If you have any usage issues, please Google them yourself
The first line contains two numbers N (village number 2 < N < 1,000) M (the number of road can repair 1 < M < 20,000) in the following M lines, each line has three digital ABC, showing length of the road between the two villages is AB C. Conditions: this road as long as possible and put together all the villages, there is no ring road