#include <stdio.h>
typedef struct
{
int math;
int information;
}student;
int main()
{
int n,i,a=1,b=0,sum=0;
student ar[1001];
scanf("%d",&n);
for (i=1; i<=n; i++)
{
scanf("%d &d",ar[i].math, &ar[i].information);
}
for (i=1; i<=n; i++)
{
if (ar[i].math >= sum)
{
sum=ar[i].math;
b=i;
}
}
}