/*
#include <stdio.h>
#include <stdlib.h>
typedef struct
{
int countries;
int student_number;
int score;
int rank;
} scr;
scr st[101]= {};
int n;
int main()
{
input();
most();
}
int input()
{
scanf("%d", &n);
for(int i=1; i<=n; i++)
{
scanf("%d %d %d", &st[i].countries, &st[i].student_number, &st[i].score);
}
}
int most()
{
int i, most=0, help=0, rank1coun, rank2coun, rank3coun;
for(int j=1; j<=3; j++)
{
if(j!=3)
{
for(i=1; i<=n; i++)
{
if(st[i].score>help)
{
help=st[i].score;
most=i;
}
}
printf("%d %d \n", st[most].countries, st[most].student_number);
if(j==1)
{
rank1coun = st[most].countries;
}
else
{
rank2coun = st[most].countries;
}
st[most].score = 0;
most=0;
help=0;
}
else
{
if(rank1coun == rank2coun)
{
for(i=1; i<=n; i++)
{
if(st[i].countries == rank1coun)
{
st[i].score=0;
}
}
}
for(i=1; i<=n; i++)
{
if(st[i].score>help)
{
help=st[i].score;
most=i;
}
}
printf("%d %d \n", st[most].countries, st[most].student_number);
}
}
}
*/
/*
#include <stdio.h>
typedef struct
{
char name[11];
int score1;
int score2;
int score3;
}scr;
int main(void)
{
int i, most=0, up=0;
int tg=0,gh=0;
scr arr[101]={};
int data;
scanf("%d", &data);
for(i=1;i<=data;i++)
{
scanf("%s %d %d %d", arr[i].name,&arr[i].score1, &arr[i].score2, &arr[i].score3);
}
for(i=1;i<=data;i++)
{
if(arr[i].score1>most)
{
up=i;
most = arr[i].score1;
}
}
for(i=1;i<=data;i++)
{
if(arr[up].score2 < arr[i].score2)
{
tg++;
}
if(arr[up].score3 < arr[i].score3)
{
gh++;
}
}
printf("%s %d %d", arr[up].name, tg+1, gh+1);
return 0;
}
*/
/*
#include <stdio.h>
typedef struct
{
char name[11];
int score;
int rank;
} scr;
int main(void)
{
int up,i,most, j;
scr st[101]= {};
int data, printfnumber;
scanf("%d %d", &data, &printfnumber);
for(i=1; i<=data; i++)
{
scanf("%s %d", st[i].name, &st[i].score);
}
for(j=1;j<=printfnumber;j++)
{
for(i=1; i<=data; i++)
{
if(st[i].score>most)
{
up=i;
most = st[i].score;
}
}
st[up].score=0;
most=0;
printf("%s\n",st[up].name);
}
}
*/