/*
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return 0;
}
*/
/*
#include <stdio.h>
typedef struct
{
int conutry;
int student;
int score;
}stu;
int main()
{
stu a[1001];
int s, max=1, mas=1, maz=1, goldc, silverc;
scanf("%d", &s);
for(int i=1; i<=s; i++)
{
scanf("%d %d %d", &a[i].conutry, &a[i].student, &a[i].score);
}
//금
for(int i=1; i<=s; i++)
{
if(a[i].score>a[max].score)
{
max=i;
}
}
printf("%d %d\n", a[max].conutry, a[max].student);
a[max].score=0;
goldc = a[max].conutry;
//은
for(int i=1; i<=s; i++)
{
if(a[i].score>a[mas].score)
{
mas=i;
}
}
printf("%d %d\n", a[mas].conutry, a[mas].student);
a[mas].score=0;
silverc = a[mas].conutry;
/////////////////
if(goldc == silverc)
{
for(int i=1; i<=s; i++)
{
if(a[i].conutry == goldc)
{
a[i].score=0;
}
}
}
//동
for(int i=1; i<=s; i++)
{
if(a[i].score>a[maz].score)
{
maz=i;
}
}
printf("%d %d \n", a[maz].conutry, a[maz].student);
a[maz].score=0;
return 0;
}
*/
/*
10
1 1 851
1 2 189
1 3 294
1 4 960
1 5 912
2 1 200
3 1 671
4 1 500
4 2 788
4 3 260
*/