This content is archived!

For the 2018-2019 school year, we have switched to using the WLMOJ judge for all MCPT related content. This is an archive of our old website and will not be updated.


“In mathematics, theorems are named after the second person to discover them, for the first is always Euler.”

Leonhard Euler was a brilliant mathematician who made significant advancements in many areas of math and science, and hence has a lot of things named after him. In this problem, you will figure out whether Euler was the first one to discover a theorem.


A test case begins with an integer N (1 \leq N \leq 1000). N lines follow, each containing a person’s name S and a year Y, which means that person S discovered the theorem in year Y. No two people will discover a theorem in the same year.


Output the name of the first person to discover the theorem.

Sample Input 1

Euler 1750
Gauss 1800

Sample Output 1


Sample Input 2

Gauss 1812
Fermat 1614
Euler 1730

Sample Output 2


Sample Input 3

Weierstrass 1858
Cantor 1902
Euler 1743
Tilikaynen 2016
Raza 2012

Sample Output 3



Read only if you are stuck or have already solved the problem.