#include<iostream>
#include<string>
using namespace std;
struct Student
{
string m_Name;
int c, m, e ,score=c+m+e;
}stu[1000];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> stu[i].m_Name >> stu[i].c >> stu[i].m >> stu[i].e;
}
int max = stu[0].score, maxIndex = 0;
for (int i = 0; i < n; i++)
{
if (stu[i].score > max) {
maxIndex = i;
}
}
cout << stu[maxIndex].m_Name <<" " << stu[maxIndex].c <<" " << stu[maxIndex].m <<" "<< stu[maxIndex].e << endl;
return 0;
}