#include<stdio.h>
#include<string.h>
#define N 5
struct scores {
char name[10];
int score1;
int score2;
int score3;
};
int main()
{
int n;
scanf("%d",&n);
struct scores name[n];
for(int i=0;i<n;i++)
{
scanf("%s %d %d %d",&name[i].name,&name[i].score1,&name[i].score2,&name[i].score3);
}
for(int i=0;i<n;i++)
{
printf("%10s %3d %3d %3d",name[i].name,name[i].score1,name[i].score2,name[i].score3);
}
}