a=int(input())
for i in range():
name,wd,kesuo=input().split()
wd=float(wd)
kesuo=int(kesuo)
if a<int(kesuo):
a=int(kesuo)
text=name
print(text)