N = int(input())
max_score = 0
for _ in range(N):
    l = input().split()
    s = l[0]
    c1 = int(l[1])
    c2 = int(l[2])
    c3 = int(l[3])
    total = c1 + c2 + c3
    if total > max_score:
        max_score = total
        best = " ".join(l)
print(best)