#include<iostream>
#include<cmath>
using namespace std;

int n,ans2,id;
double ans,bmi,w,h;

double EPS = 1e10;

int main(){
  while(cin>>n&&n){
    ans=9999.9;
    for(int i=0;i<n;i++){
      cin>>id>>h>>w;
      bmi=abs( w/((h/100.0)*(h/100.0)) -22.0);
      if(bmi<ans){
	ans=bmi;ans2=id;
      }else if(bmi - EPS <ans && id<ans2){
	ans2=id;
      }
    }
    cout<<ans2<<endl;
  }
  return 0;
}