#include <bits/stdc++.h>
using namespace std;
struct xxx{
int a,b,w,c;
}s[110000];
bool cmp(xxx x,xxx y){
if(x.w>y.w)
{
return true;
}
else if(x.w==y.w&&x.a<y.a)
{
return true;
}
return false;
}
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>s[i].a>>s[i].b;
s[i].w=s[i].b/s[i].a;
s[i].c=i;
}
stable_sort(s+1,s+1+n,cmp);
cout<<s[1].c;
return 0;
}