LCC '22 Contest 2 J2 - Burj Kha-leaf-a
View as PDFThe Burj Khalifa is the tallest building in the world. Standing 828 meters above the ground, it is over 2.5 times the height of the Eiffel Tower and nearly 150 meters taller than the world's next-tallest building.
Aaron has a list of  buildings from around the world, numbered from 
 to 
. He knows the Burj Khalifa is one of these buildings, and he decides to compare the heights between buildings to find which numbered building corresponds to the Burj.
His comparison process consists of  total comparisons, each of which is between two buildings 
 and 
, where building 
 is taller than building 
. Building 
 will then no longer appear in any subsequent comparisons, as Aaron knows it cannot be the tallest building. It is guaranteed that after all buildings are compared, one building can be determined to be taller than the rest.
Using the results from Aaron's comparison process, can you determine which number corresponds to the Burj Khalifa?
Constraints
Input Specification
The first line of input will contain two integers,  and 
.
The next  lines of input will each contain two integers, 
 and 
.
Output Specification
Output one integer, the building number that corresponds to the Burj Khalifa.
Sample Input
5 4
1 2
3 4
1 3
5 1
Sample Output
5
Comments