n = int(input())
mini = 201
primes = []
for _ in range(n):
sentence = str(input())
primes.append(sentence)
for i in range(n):
sentence = primes[i]
primes2 = sentence.split(" ")
height = int(primes2[3])
if height < mini:
mini = height
index = i
del primes[index]
mini = 201
for i in range(len(primes)):
sentence = primes[i]
primes2 = sentence.split(" ")
height = int(primes2[3])
if height < mini:
mini = height
answer = sentence
print(answer)