Planned roads between cities. N cities, M planned roads. Each road has a unique time moment value. The values are between 1 and M.

Format of files:

First line contains value of N
Second line contains value of M
Next M lines contain  triplets of the form city1 city2 moment