/**#include<stdio.h>
typedef struct
{
int order;
int score;
int JONGBO;
}student;
int main()
{
student a[1001]={};
student temp;
int d;
scanf("%d\n",&d);
for(int i=1;i<=d;i++)
scanf("%d %d",&a[i].score,&a[i].JONGBO);
a[i].order=i;
for(int i=1;i<d;i++)
{
for(int j=1;j<=d-i;j++)
{
if(a[j].score<a[j+1].score)
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
else if(a[j].score==a[j+1].score)
{
if(a[j].JONGBO<a[j+1].JONGBO)
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
else if(a[j].JONGBO==a[j+1].JONGBO)
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
}
for(int i=1;i<=d;i++)
{
printf("%d %d %d\n",a[i].order,a[i].score,a[i].JONGBO);
}
}#include<stdio.h>
#include<string.h>
typedef struct{
char s[100];
int year;
int month;
int day;
}LOL;
int main()
{
LOL a[101]={};
LOL temp;
int d;
char f[100];
scanf("%d",&d);
for(int i=1;i<=d;i++)
{
scanf("%s %d %d %d",f,&a[i].year,&a[i].month,&a[i].day);
}
for(int i=1;i<d;i++)
{
for(int j=1;j<=d-i;j++)
{
if(a[j].year<a[j+1].year)
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
else if(a[j].month<a[j+1].month)
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
else if(a[j].day<a[j+1].day)
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
for(int i=1;i<=d;i++)
printf("%s\n",f[i]);
}**/