#include <stdio.h>
#include <string.h>
struct test
{
char name[9];
int chin;
int math;
int eng;
};
int main()
{
int max = -1;
int N;
scanf("%d", &N);
char na[9];
int ch = 0;
int ma = 0;
int en = 0;
for (int k = 0; k < N; k++)
{
struct test store;
int sum;
scanf("%s", store.name);
scanf("%d%d%d", &store.chin, &store.math, &store.eng);
sum = store.chin + store.math + store.eng;
if (sum > max)
{
max = sum;
for (int q = 0; q < 9; q++)
{
if (store.name[q] == '\0')
{
break;
}
na[q] = store.name[q];
}
ch = store.chin;
ma = store.math;
en = store.eng;
}
}
for (int y = 0; y < 9; y++)
{
if (na[y] == '\0')
{
break;
}
printf("%c", na[y]);
}
printf(" ");
printf("%d %d %d", ch, ma, en);
return 0;
}