#include<bits/stdc++.h>
using namespace std;
struct Stu{
string _name;
int _s1;
int _s2;
int _s3;
int _sRes;
}_myArray[1005];
int _num;
bool cmp(Stu,Stu);
void ParseIn(){
cin>>_num;
for(int i=0;i<_num;i++){
cin>>_myArray[i]._name>>_myArray[i]._s1>>_myArray[i]._s2>>_myArray[i]._s3;
_myArray[i]._sRes=_myArray[i]._s1+_myArray[i]._s2+_myArray[i]._s3;
}
}
void Core(){
sort(_myArray,_myArray+_num,cmp);
}
void CWriteOut(){
cout<<_myArray[0]._name<<' '<<_myArray[0]._s1<<' '<<_myArray[0]._s2<<' '<<_myArray[0]._s3<<endl;
}
int main(){
ParseIn();
Core();
CWriteOut();
return 0;
}
bool cmp(Stu a,Stu b){
if(a._sRes>b._sRes){
return 1;
}
return 0;
}