#include<stdio.h>
int main()
{
struct student
{
int num;
char sex;
int score;
char name[];
char location[];
};
struct student student1,student2;
scanf("%d%c%d%s%s%d%c%d%s%s",&student1.num,&student1.sex,&student1.score,student1.name,student1.location,&student2.num,&student2.sex,&student2.score,student2.name,student2.location);
if(student1.score>student2.score)
printf("num:%d\nsex:%s\nscore:%d\nname:%s\nlocation:%s\n",student1.num,student1.sex,student1.score,student1.name,student1.location);
else if(student1.score<student2.score)
printf("num:%d\nsex:%s\nscore:%d\nname:%s\nlocation:%s\n",student2.num,student2.sex,student2.score,student2.name,student2.location);
else
{printf("num:%d\nsex:%c\nscore:%d\nname:%s\nlocation:%s\n",student2.num,student2.sex,student2.score,student2.name,student2.location);
printf("num:%d\nsex:%c\nscore:%d\nname:%s\nlocation:%s\n",student1.num,student1.sex,student1.score,student1.name,student1.location);
}
return 0;
}