#include <iostream>
using namespace std;
struct Person {
string s;
int c1, c2, c3, t;
// 构造函数初始化
Person(string name = "", int s1 = 0, int s2 = 0, int s3 = 0) {
s = name, c1 = s1, c2 = s2, c3 = s3,
t = c1 + c2 + c3; // 显式赋值
}
bool operator>(const Person& other) const {
return t > other.t;
}
}arr[1000];
int main() {
int n;
cin >> n;
Person max("", 0, 0, 0); // 初始化 max 为默认值
for (int i = 0; i < n; i++)
{
string name;
int s1, s2, s3;
cin >> name >> s1 >> s2 >> s3;
arr[i] = Person(name, s1, s2, s3);
if (arr[i] > max) max = arr[i];
}
cout << max.s << " " << max.c1 << " " << max.c2 << " " << max.c3 << endl;
return 0;
}