#include<bits/stdc++.h>
using namespace std;
struct stu {
string name;
int chi;
int mat;
int eng;
int tot;
} students[10010];
int main(void) {
int n;
int score = -1;
int t = 0;
stu* p = students;
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%s%d%d%d", &((p + i)->name), &((p + i)->chi), &((p + i)->mat), &((p + i)->eng));
(p + i)->tot = (p + i)->chi + (p + i)->mat + (p + i)->eng;
if ((p + i)->tot > score) {
score = (p + i)->tot;
t = i;
}
}
printf("%s %d %d %d\n", (p + t)->name, (p + t)->chi, (p + t)->mat, (p + t)->eng);
return 0;
}