def find_top_student():
    n = int(input().strip())
    top_student = None
    max_score = -1

    for _ in range(n):
        line = input().strip().split()
        name = line[0]
        scores = list(map(int,line[1:4]))
        total_scores = sum(scores)

        if total_scores > max_score:
            max_score = total_scores
            top_student = (name,scores)
    print(f"{top_student[0]} {' '.join(map(str,top_student[1]))}")


if __name__ == "__main__":
    find_top_student()