/*#include <stdio.h>
#include <stdlib.h>
int main()
{
srand(time(NULL));
for(int i=1;i<=100;i++)
{
if(rand()%2==0)
printf("Hello world!\n");
else
printf("bye world!\n");
}
return 0;
}
*/
/*#include <stdio.h>
typedef struct
{
int sco;
int d;
} stu;
int main()
{
stu arr[201]={};
int a, i, j;
scanf("%d", &a);
for(i=1;i<=a;i++)
{
scanf("%d", &arr[i].sco);
}
for(i=1;i<=a;i++)
{
for(j=1;j<=a;j++)
{
if(arr[j].sco>arr[i].sco)
arr[i].d++;
}
printf("%d %d\n", arr[i].sco, arr[i].d+1);
}
return 0;
}*/
#include <stdio.h>
#include <string.h>
typedef struct
{
char name[10];
int a;
int b;
int c;
} student;
int main()
{
student arr[101]
int n, i, j, topsc=0, topst;
scanf("%d", &n);
for(i=1;i<=n;i++)
{
gets(arr[i].name);
scanf("%d %d %d", arr[i].a, arr[i].b, arr[i].c);
}
for(i=1;i<=a;i++)
{
if(topsc<arr[i].a)
topst=i;
}
printf("%s ", arr[topst].name);
}



