#include <iostream>
#include <stack>
using namespace std;
int main() {
struct student{
string fam, name;
int m,f,i,s;
};
int n, mx;
cin>>n;
student a[n];
for(int i=0; i<n; i++){
cin>>a[i].fam>>a[i].name>>a[i].m>>a[i].f>>a[i].i;
a[i].s=a[i].m+a[i].f+a[i].i;
mx=max(a[i].s, mx);
}
for(int i = 0; i < n; i++) {
if(a[i].s == mx) {
cout << a[i].fam << " " << a[i].name << endl;
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RhY2s+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCXN0cnVjdCBzdHVkZW50ewoJCXN0cmluZyBmYW0sIG5hbWU7CgkJaW50IG0sZixpLHM7Cgl9OwoJaW50IG4sIG14OwoJY2luPj5uOwoJc3R1ZGVudCBhW25dOwoJZm9yKGludCBpPTA7IGk8bjsgaSsrKXsKCQljaW4+PmFbaV0uZmFtPj5hW2ldLm5hbWU+PmFbaV0ubT4+YVtpXS5mPj5hW2ldLmk7CgkJYVtpXS5zPWFbaV0ubSthW2ldLmYrYVtpXS5pOwoJCW14PW1heChhW2ldLnMsIG14KTsKCX0KCSBmb3IoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgICAgaWYoYVtpXS5zID09IG14KSB7CiAgICAgICAgICAgIGNvdXQgPDwgYVtpXS5mYW0gPDwgIiAiIDw8IGFbaV0ubmFtZSA8PCBlbmRsOwogICAgICAgIH0KICAgIH0KCXJldHVybiAwOwp9