N = int(input())
T = []
t = []
S = []
for _ in range(N):
    s, c1, c2, c3 = map(lambda x: int(x) if x.isdigit() else x, input().split())
    T.append(c1 + c2 + c3)
    t.append((c1, c2, c3))
    S.append(s)

max_value = max(T)
index = T.index(max_value)

print(f"{S[index]} {t[index][0]} {t[index][1]} {t[index][2]}")