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)
	}
}

C++: #include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
#include <string.h>
#include <complex>
using namespace std;

const int INF = 1<<29;
const double EPS = 1e-8;
typedef vector<int> vec;
typedef pair<int,int> P;


int main(){
    while(1){
        int n;
        scanf("%d",&n);
        if(!n)break;

        vector<P> patients(n);
        for(int i=0;i<n;i++){
            int p,d1,d2;
            scanf("%d%d%d",&p,&d1,&d2);
            patients[i] = P(d1+d2,p);
        }
        sort(patients.begin(),patients.end());
        cout << patients[n-1].second << " " << patients[n-1].first << endl;
    }

    return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
int main() {
	while (1) {
		int  N; cin >> N;
		if (!N)break;
		int amax = -1;
		int id = 0;
		for (int i = 0; i < N; ++i) {
			int p, d1, d2; cin >> p >> d1 >> d2;
			if (amax < d1 + d2) {

				id = p;
				amax = d1 + d2;
			}

		}
		cout << id<< " "<<amx<< endl;
	}
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

vector<P> vp;
int n, a, b, c;

int main(){
	while (cin >> n&&n){
		REP(i, n){
			cin >> a >> b >> c;
			vp.push_back(P(b + c, a));
		}
		sort(ALL(vp), greater<P>());
		cout << vp[0].second << " " << vp[0].first << endl;
		vp.clear();
	}
}

C++: #include <iostream>
using namespace std;
int main(void){
	int n,max_id,max_value,id,a,b;

	while(true){
		scanf("%d",&n);
		if(n == 0)break;

		max_value = -1;

		for(int i = 0; i < n; i++){
			scanf("%d %d %d",&id,&a,&b);
			if(max_value < a + b){
				max_value = a + b;
				max_id = id;
			}
		}
		printf("%d %d\n",max_id,max_value);
	}

    return 0;
}

C++: #inclue<stdio.h>
int main(void)
{
	int n,max,i,p[10000],d1,d2,d[10000],x;
	while(1){
		max=0;
		scanf("%d",&n);
		if(n==0)break;
		for(i=0;i<n;i++){
			scanf("%d %d %d",&p[i],&d1,&d2);
			d[i]=d1+d2;
		}
		for(i=0;i<n;i++){
			if(max<d[i]){
				max=d[i];
				x=p[i];
			}
		}
		printf("%d %d\n",x,max);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define endl    '\n'
using namespace std;

typedef long long ll;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    int id, d1, d2;
    int max_id, max_v;

    cin >> n;

    while (n != 0) {
        max_v = -1;

        for (int i = 0; i < n; i++) {
            cin >> id >> d1 >> d2;

            if (max_v < d1 + d2) {
                max_id = id;
                max_v  = d1 + d2;
            }
        }

        cout << max_id << " " << max_v << endl;

        cin >> n;
    }

    return 0;
}

C++: #include <stdio.h>

int main(void){
	int n;
	int bestP, bestD, p, d1,d2;
	
	while (scanf("%d",&n), n){
		bestD = bestP = 0;
		for (int i=0; i<n; i++){
			scanf("%d %d %d", &p, &d1, &d2);
			if (d1+d2 > bestD){
				bestD = d1+d2;
				bestP = p;
			}
		}
		printf("%d %d\n", bestP, bestD);
	}
	return 0;
}

C++: #include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
//#include <utility>
//#include <memory>
//#include <functional>
//#include <deque>
//#include <cctype>
//#include <ctime>
//#include <numeric>
//#include <list>
//#include <iomanip>

//#if __cplusplus >= 201103L
//#include <array>
//#include <tuple>
//#include <initializer_list>
//#include <forward_list>
//
//#define cauto const auto&
//#else

//#endif

using namespace std;


typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif
#define LDcout(x,n) fixed<<setprecision(n)<<x

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	int n;
	while(cin>>n,n){
		vector<pii> v(n);
		rep(i,n){
			int a,b,c;
			cin>>a>>b>>c;
			v[i]=pii(b+c,a);
		}
		sort(ALL(v));
		cout<<v.back().S<<" "<<v.back().F<<endl;
	}
}


signed main() {
	ios_base::sync_with_stdio(false);
    cin.tie(0);
  	cout<<fixed<<setprecision(20);
    mainmain();
}

C++: #include<iostream>

using namespace std;

int main(){
	//??????????????§????????°????????????????????????????????? = ????????????
	while(true){
		int n;
		cin >> n;
		if (n == 0) break;

		int max_p = 0, max_d = 0;
		for (int i = 0; i < n; i++) {
			int p, d1, d2;
			cin >>p >> d1 >> d2;

			if (max_d <=  d1 + d2) {
				max_d = d1 + d2;
				max_p = p;
			}
		}
		cout << max_p << " " << max_d << endl;
	}

	return 0;

C++: #include <iostream>
using namespace std;
int main(void){
    int n;
    while(true){
        cin >> n;
        if(n==0)break;
        int maxp=0,maxv=-1,p,a,b;
        for(int i=0;i<n;i++){
            cin >> p >> a >> b;
            if(maxv < (a+b)){
                maxv = a+b;
                maxp = p;
            }
        }
        cout << maxp << " " << maxv << endl;
    }
    return 0;
}