#include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int gcd(int a,int b){
  int i;
  if(a<b)
    swap(a,b);
  for(i=1;a%(b/i);)
    for(i++;b%i;i++);  
  return b/i;
}
long long lcm(int a,int b){
  return (long long)a*b/gcd(a,b);
}
int main(){
  int i;
  int n,b,h,w,bb,hh,ww;
  long long l;
  for(;;){
    cin>>n;
    if(n==0)
      break;
    cin>>bb>>hh>>ww;
    for(i=1;i<n;i++){
      cin>>b>>h>>w;
      l=lcm(hh*hh,h*h);
      if(llabs(ww*10000*l/hh/hh-l*22)>llabs(w*10000*l/h/h-l*22)){
	bb=b;
	hh=h;
	ww=w;
      }
    }
    cout<<bb<<endl;
  }
  return 0;
}