#include
#include
using namespace std;
struct student {
int chinese,math,english;
string name;
} a,ans;
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a.name>>a.chinese>>a.math>>a.english;
if(a.math+a.chinese+a.english>ans.math+ans.chinese+ans.english)
ans=a;
}cout<<ans.name<<" "<<ans.chinese<<" "<<ans.math<<" "<<ans.english<<endl;
return 0;
}