#include<bits/stdc++.h>
using namespace std;
const int N=1e3+10;
struct Students{
string name;
int c1,c2,c3,t,number;
}s[N];
bool cmp(Students stu1,Students stu2){
if(stu1.t==stu2.t){
return stu1.number<stu2.number;
}else{
return stu1.t>stu2.t;
}
}
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>s[i].name>>s[i].c1>>s[i].c2>>s[i].c3;
s[i].t=s[i].c1+s[i].c2+s[i].c3;
s[i].number=i;
}
sort(s,s+n,cmp);
cout<<s[0].name<<" "<<s[0].c1<<" "<<s[0].c2<<" "<<s[0].c3;
return 0;
}

京公网安备 11010502036488号