Problem B - A real drag ----------------------- Drag racing is a big problem in a certain big city. The police want to stop this because there are too many accidents. However, like all police departments, they are shorthanded and cannot patrol all streets. So they come up with the following solution. They collect statistics on the number of accidents on each street. Then they wish to compute the pair of endpoints on which the risk of accidents is maximum, and forbid racing between these endpoints. You are required to write a program to help them out. For simplicity, think of each intersection or endpoint as a node. You are given the number of nodes. The number of streets are also given to you -- each street connects two nodes. For each street, you are given the probability of a driver having an accident on this street. Output the pair of endpoints that the police wish to compute. You may assume all streets to be bidirectional and each direction to have the same probability of an accident. Input ----- Input consists of multiple cases. Each case starts with a line containing 2 positive integers N, E (N < 200) that indicates the number of intersections and the number of streets. The next E lines contain 3 numbers each, the first 2 denoting two intersections and the last one the probability of a driver having an accident driving through this street. Input is terminated by a line containing two zeroes. This line should not be processed. Output ------ For each line of input produce one line of output containing two endpoints in decreasing order. Sample Input ------------ 6 5 0 5 0.1 1 5 0.1 2 5 0.1 3 5 0.9 4 5 0.9 0 0 Output for Sample Input ----------------------- 4 3