#P438. 练76.2 精挑细选

练76.2 精挑细选

Description

Xiao Wang is the warehouse manager of a company. One day, he received a task: to find a steel pipe from the warehouse. This sounds simple, but the requirements for this pipe are quite challenging:
The pipe must be the longest in the warehouse;
Among the longest pipes, it must be the thinnest;
Among the pipes meeting the first two criteria, it must have the largest code (each pipe has a unique code, with larger codes indicating more recent production dates).
While the relevant information is available, manually selecting the pipe that meets these requirements from hundreds of steel pipe materials would be difficult. Please write a program to help him solve this problem.

Input Format

The first line contains an integer nn (1n10001≤n≤1000), representing the number of steel pipes in the warehouse.
The next nn lines each contain three integers, representing the length (in millimeters, within the range [11, 1000010000]), diameter (in millimeters, within the range [11, 100100]), and code (a 9-digit integer) of each pipe.

Output Format

Output a single 9-digit integer, representing the code of the selected pipe.

Sample

4
3000 50 872198442
3000 45 752498124
2000 60 765128742
3000 45 652278122
752498124