#include<bits/stdc++.h>
using namespace std;
struct student{
    string name;
    int c1,c2,c3,t;
    student(string A,int B,int C,int D){
        name =A,c1=B,c2=C,c3=D,t=B+C+D;
    }
    student()=default;
    bool operator>(const student &x) const{
        return t>x.t;
    }
}a[2000];
string A;
int B,C,D;
int main(){
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>A>>B>>C>>D;
        a[i]=student(A,B,C,D);
    }
    student ans=a[1];
    for(int i=2;i<=n;i++){
        if(a[i]>ans) ans=a[i];
    }
    cout<<ans.name<<' '<<ans.c1<<' '<<ans.c2<<' '<<ans.c3<<endl;  
}