`
# include <bits/stdc++.h>
using namespace std;
struct student
{
string name;
int y,s,w;
}s[1005];
int n,maxx,t;
int main()
{
cin>>n;
for (int i = 0; i < n; i++)
{
cin>>s[i].name>>s[i].y>>s[i].s>>s[i].w;
if (maxx < s[i].y + s[i].s + s[i].w)
{
maxx = s[i].y + s[i].s + s[i].w;
t = i;
}
}
cout<<s[t].name<<" "<<s[t].y<<" "<<s[t].s<<" "<<s[t].w;
return 0;
}