Gasoline
Between points numbered 1, 2, ..., N (N ≤ 150), a network of roads has been established. The length of each road is known. This road network allows travel between any two points. Gas stations are located only at these points. Your task is to determine the maximum distance a car must be able to travel on a single tank of gas to ensure it can move between any two points in this network without needing to refuel.
Input
The first line of the input file contains the numbers N and K (the number of roads). The following K lines describe pairs of points connected by roads and the distance between them — a non-negative integer in kilometers, which does not exceed 10000. K ≤ 150^2.
Output
The output file should contain a single number — the maximum distance that can be traveled without refueling.