#include<iostream>
#include<cstdlib>
#include<algorithm>
using namespace std;
typedef struct {
  int no;
  double BMI,abs;
}P;
int main(){
  int n,a,b,c;
  while(1){
    cin >> n;
    if(n==0)break;
    P temp;
    P sets[n];
    for(int i=0;i<n;i++){
      cin >> sets[i].no >> b >> c;

      sets[i].BMI=double(c)/((double)(b)/100.0*(double)(b)/100.0);
      if(sets[i].BMI<=22){
	sets[i].abs=22-sets[i].BMI;
      }else{
	sets[i].abs=sets[i].BMI-22;
      }
    }
    for(int i=0;i<n-1;i++){
      for(int j=n-1;j>i;j--){
	if(sets[j].abs<sets[j-1].abs){
	  temp=sets[j];
	  sets[j]=sets[j-1];
	  sets[j-1]=temp;
	}
      }
    }
    for(int i=0;i<n-1;i++){
      for(int j=n-1;j>i;j--){
	if(sets[j].abs==sets[j-1].abs && sets[j].no<sets[j-1].no){
	  temp=sets[j];
	  sets[j]=sets[j-1];
	  sets[j-1]=temp;
	}
      }
    }
    cout << sets[0].no << endl;
  }
}