Go: package main

import (
	"bufio"
			"os"
	"strconv"
	"strings"
	"sort"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

type Patient struct {
	ID, Distance int
}
type ByDistance []Patient
func (p ByDistance) Len() int { return len(p) }
func (p ByDistance) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func (p ByDistance) Less(i, j int) bool { return p[i]. Distance > p[j].Distance }

func main() {
	for scanner.Scan() {
		n, _ := strconv.Atoi(scanner.Text())
		if n == 0 {
			break
		}
		patients := make([]Patient, n)
		for i := 0; i < n; i++ {
			scanner.Scan()
			buf := strings.Split(scanner.Text(), " ")
			id, _ := strconv.Atoi(buf[0])
			am, _ := strconv.Atoi(buf[1])
			pm, _ := strconv.Atoi(buf[2])
			patients[i] = Patient{id, am+pm}
		}
		sort.Sort(ByDistance(patients))
		fmt.Println(patients[0].ID, patients[0].Distance)
	}
}

Python: while True:
    n = int(input())
    if n == 0:
        break

    patients = []
    for _ in range(n):
        p, d1, d2 = map(int, input().split())
        patients.append((p, d1+d2))
    print(*max(patients, key=lambda x: x[1]))

Python: from operator import itemgetter as I
while True:
    n= int(input())
    if n==0: break
    d=dict()
    for _ in range(n):
        p,d1,d2= map(int, input().split())
        d[p]= d1+d2
    print(*sorted(d.items(), key=I(1))[-1])

Python: while True:
    N=int(input())
    if N==0: break
    P=[[int(i) for i in input().split()]for _ in range(N)]
    P.sort(key=lambda x: x[1]+x[2])
    print(P[-1][0],P[-1][1]+P[-1][2])

Python: while 1:
    n=int(input())
    if n==0:break
    top=0
    score=0
    for i in range(n):
        p,d1,d2=map(int,input().split())
        if score<d1+d2:
            top=p
            score=d1+d2
    print(top,score)

Python: while True:
    num = int(input())
    if num == 0:
        break
    
    m = 0
    mp = None
    for _ in range(num):
        p, d1, d2  = [int(x) for x in input().split()]
        if d1 + d2 > m:
            m = d1 + d2
            mp = p
    print(mp,m)

Python: while True:
    N=int(input())
    if N== 0:
        break
    B=0
    V=0
    for i in range(N):
        p,d,g=map(int,input().split())
        S=d+g
        if S>V:
            V=S
            B=p
    print(B,V)

Python: while True:
    hosuu = {}
    hosu = []
    i = int(input())
    if i == 0:
        break
    else:
        for num in range(i):
            a,b,c = input().split(" ")
            num1 = int(b) + int(c)
            a = int(a)
            hosuu[num1] = a
            hosu.append(num1)
        hosu.sort()
        hosu.reverse()
        print(str(hosuu[hosu[0]]) + " " + str(hosu[0]))

Python: while 1:
    n = int(input())
    if n == 0:
        break
    x = {}
    for i in range(n):
        p,d1,d2 = map(int,input().split())
        v = d1 + d2
        x[p] = v
    x = sorted(x.items(), key=lambda x:x[1])
    print(f'{x[n-1][0]} {x[n-1][1]}')

Python: while 1:
    n = int(input())
    if n == 0: break
    dmax = 0
    for i in range(n):
        p, d1, d2 = map(int, input().split())
        if d1+d2 > dmax: id, dmax = p, d1+d2
    print(id, dmax)

Python: while 1:
    n = int(input())
    if n == 0:
        break
    L = []
    for i in range(n):
        p,d1,d2  = map(int,input().split())
        L.append((p,d1+d2))

    L.sort(key = lambda x :-x[1])
    print(L[0][0],L[0][1])

Python: while 1:
    n = int(input())
    if n == 0:
        break

    large = 0
    for _ in range(n):
        p, d1, d2 = map(int, input().split())
        if large < d1 + d2:
            large = d1 + d2
            number = p

    print(number, large)

Python: while True:
  n = int(input())
  if n == 0:
    break
  lst = []
  for _ in range(n):
    p, d1, d2 = map(int, input().split())
    lst.append((d1 + d2, p))
  lst.sort()
  print(lst[-1][1], lst[-1][0])

Python: while 1:
    n=int(input())
    if n==0:break
    a=[map(int, input().split()) for _ in range(n)]
    a=[[p,d1+d2] for p, d1, d2 in a]
    a.sort(key=lambda b:b[1])
    print(*a[-1])

Python: while 1:
  n = int(input())
  if n== 0: break
  dmax = 0
  for i in range(n):
      p, d1, d2 = map(int,input().split())
      if d1+d2>dmax:
        id,dmax=p,d1+d2
  print(id,dmax)

Python: while True:
    n = int(input())
    if n==0: break
    km= 0
    for i in range(n):
        p,d1,d2 = map(int,input().split())
        m = d1 +d2
        if km < m:
            km = m
            a = p
     
    print(a,km)

Python: while True :
    n = int(input())
    if n == 0 :
        break
    max_d = 0
    max_p = 0
    for i in range(n) :
        p, a, b = map(int, input().split())
        if max_d < (a + b) :
            max_d = a + b
            max_p = p
    print(max_p, max_d)

Python: while 1:
    n = int(input())
    if n == 0:break
    md = [0,0,0]
    for i in range(n):
        p = list(map(int,input().split()))
        if md[1]+md[2] < p[1]+p[2]:
            md = p
    print(md[0],str(md[1]+md[2]))

Python: while True:
  n = int(input())
  if n == 0:
    break
  
  large = 0
  for _ in range(n):
    p, d1, d2 = map(int, input().split())
    if large < d1 + d2:
      large = d1 + d2
      number = p
      
  print(number, large)

Python: # Aizu Problem 0217: Walking in the Hospital

import sys, math, os, fractions

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


while True:
    n = int(input())
    if n == 0:
        break
    high = 0
    for _ in range(n):
        no, w1, w2 = [int(__) for __ in input().split()]
        w = w1 + w2
        if w > high:
            high = w
            patient = no
    print(patient, high)

Python: while True:
    n = int(input())
    if n == 0:
        break
    walk = []
    for i in range(n):
        p,d1,d2 = map(int,input().split())
        walk.append([d1+d2,p])
    walk.sort(reverse = True)
    print(walk[0][1],walk[0][0])

Python: while(True):
    n = int(input())
    if not n: break
    maxind = 0
    maxnum = 0
    for _ in range(n):
        a,b,c = map(int,input().split())
        if maxnum < b+c: maxind=a; maxnum=b+c
    print(maxind,maxnum)

Python: # -*- coding: utf-8 -*-
"""
Walking in the Hospital
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0217

"""
import sys


def solve(n):
    result = sorted([[int(i) for i in input().split()] for _ in range(n)], key=lambda x: x[1]+x[2])
    return result[-1][0], sum(result[-1][1:])


def main(args):
    while True:
        n = int(input())
        if n == 0:
            break
        ans = solve(n)
        print(*ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Python: # AOJ 0217 Walking in the Hospital
# Python3 2018.6.23 bal4u

while 1:
	n = int(input())
	if n == 0: break
	dmax = 0
	for i in range(n):
		p, d1, d2 = map(int, input().split())
		if d1+d2 > dmax: id, dmax = p, d1+d2
	print(id, dmax)

Python: while True:
    n = int(input())
    if n == 0:
        break
    ls = []
    for i in range(n):
        v = list(map(int,input().split()))
        ls.append((sum(v[1:]),v[0]))
    ls.sort()
    ls.reverse()
    print(ls[0][1],ls[0][0])

Python: while True:
    n = int(input())
    if n == 0:
        break
    arr = []
    for i in range(n):
        tmp = list(map(int, input().split()))
        arr.append([tmp[0], tmp[1] + tmp[2]])
    arr.sort(key = lambda x: x[1], reverse=True)
    print("{} {}".format(arr[0][0], arr[0][1]))

Python: import sys
f = sys.stdin

import operator

while True:
    n = int(f.readline())
    if n == 0:
        break
    pd = [map(int, f.readline().split()) for _ in range(n)]
    pd = [[p, d1 + d2] for p, d1, d2 in pd]
    pd.sort(key=operator.itemgetter(1))
    print(*pd[-1])

Python: while True:
    N = int(input())
    if N == 0:
        break

    ans1 = -1
    ans2 = -1
    for i in range(N):
        p,d1,d2 = [int(j) for j in input().split()]
        if d1+d2 > ans2:
            ans1 = p
            ans2 = d1+d2
    print(ans1,ans2)