#include<iostream>
using namespace std;
int a,b,c,n,t[1000001],ansno;
double weight,height,bmi,bmi2,ansbmi;
int main(){
  while(1){
    cin>>n;
    if(n==0)break;
    ansbmi=99999.9;
    ansno=9999999;
    for(int i=0;i<n;i++){
      cin>>a>>height>>weight;
      height/=100.0;
      bmi=weight/(height*height);
 
      bmi2=22.0-bmi;
       
      if(bmi2<0.0)bmi2*=-1.0;
      //cout<<bmi2<<endl;
      if(ansbmi>bmi2){
    ansbmi=bmi2;
    ansno=a;
      }
      if(ansbmi==bmi2&&ansno>a){
    ansbmi=bmi2;
    ansno=a;
      }
 
    }
    cout<<ansno<<endl;
     
  }
  return 0;
}