#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef struct{
char name[8];
int c1;
int c2;
int c3;
} stu;
int main(){
int n;
cin >> n;
vector<stu> arr(n);
int max = -100000;
int maxindex = 0;
for(int i = 0;i < n;i++){
scanf("%s %d %d %d",&arr[i].name,&arr[i].c1,&arr[i].c2,&arr[i].c3);
if(max < arr[i].c1+arr[i].c2+arr[i].c3){
max = arr[i].c1+arr[i].c2+arr[i].c3;
maxindex = i;
}
}
printf("%s %d %d %d",arr[maxindex].name,arr[maxindex].c1,arr[maxindex].c2,arr[maxindex].c3);
return 0;
}