class ABC {
int a,b;
public ABC(int a, int b) {this.a=a; this.b=b;}
public int compareTo(ABC x) {return a*b-x.a*x.b;}
}
public class XXK5 {
public static void main(String[] args) {
int [][]d={{3,8},{4,6},{5,6},{2,9},{6,7},{5,8}};
ABC []ar=new ABC[d.length];
int i,k=0;
for(i=0; i<ar.length; i++)
ar[i]=new ABC(d[i][0],d[i][1]);
for(i=1; i<ar.length; i++)
if(ar[i].compareTo(ar[k])>0) k=i;
System.out.println("k="+k);
}
}