/*#include <stdio.h>
typedef struct
{
int num;
int math;
int info;
}soohumsaeng;
int main()
{
soohumsaeng arr[1001];
int n, i, j;
scanf("%d", &n);
for(i=1;i<=n;i++)
{
scanf("%d %d", &arr[i].math, &arr[i].info);
arr[i].num=i;
}
for(i=1;i<n;i++)
{
for(j=1;j<=n-i;j++)
{
if(arr[j].math<arr[j+1].math)
{
arr[0]=arr[j];
arr[j]=arr[j+1];
arr[j+1]=arr[0];
}
else if(arr[j].math==arr[j+1].math)
{
if(arr[j].info<arr[j+1].info)
{
arr[0]=arr[j];
arr[j]=arr[j+1];
arr[j+1]=arr[0];
}
else if(arr[j].info==arr[j+1].info)
{
if(arr[j].num>arr[j+1].num)
{
arr[0]=arr[j];
arr[j]=arr[j+1];
arr[j+1]=arr[0];
}
}
}
}
}
for(i=1;i<=n;i++)
{
printf("%d %d %d\n", arr[i].num, arr[i].math, arr[i].info);
}
return 0;
}*/
#include <stdio.h>
#include <string.h>
typedef struct
{
char name[101];
int deadline;
} schedule;
int main()
{
schedule arr[101];
int a, b, c, i, j, n;
scanf("%d", &n);
for(i=1;i<=n;i++)
{
scanf("%s %d %d %d", arr[i].name, &a, &b, &c);
arr[i].deadline = a*10000+b*100+c;
}
}



