#include<bits/stdc++.h>
using namespace std;
int sum[1001];
int maxx;
struct student{
string name;
int eng;
int chi;
int mat;
}q[1001];
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>q[i].name>>q[i].chi>>q[i].mat>>q[i].eng;
sum[i]=q[i].chi+q[i].eng+q[i].mat;
max(maxx,sum[i]);
}
for(int i=0;i>n;i++)
{
if(sum[i]==maxx) cout<<q[i].name<<q[i].chi<<q[i].mat<<q[i].eng;
}
return 0;
}