#C7047. Minimum Travel Time

    ID: 50875 Type: Default 1000ms 256MiB

Minimum Travel Time

Minimum Travel Time

You are given a railway network connecting N cities with M train lines. Each train line connects two cities u and v with a travel time t (in minutes). Your task is to determine the minimum travel time among all the train lines. In other words, you need to find the smallest t among all the provided connections.

Note: The problem guarantees that there is at least one train line. Read the input from standard input and output the result to standard output.

inputFormat

The first line contains two integers N and M — the number of cities and the number of train lines respectively. Each of the next M lines contains three integers u, v, and t, representing a train line from city u to city v with travel time t minutes.

outputFormat

Output a single integer, which is the minimum travel time among all the given train lines.

## sample
3 3
1 2 10
2 3 5
1 3 20
5

</p>