#include<iostream>
using namespace std;
int main()
{
 while(true){

      int n;
      int a, h , w;
      double BMI = 0;
      double H = 0;
      double max = 0;
      double Max = 0;
      int x=0,y=0,z=0;
     
	  cin >> n ;

      if(n==0)
         break;

      for(int i=0 ;i<n ;i++){

            cin >> a >> h >> w;
            H = h / 100;

            BMI = w / (H*H);

            if(BMI < 22){
                if(max == 0){
                     max = BMI;
					 x = a;
				}
                else if(BMI < max){
					max = BMI;
                    x = a;
				}
            }
            if(22 < BMI){
                if(Max == 0){
                  Max = BMI;
				  y = a;
				}
				else if(BMI > Max){
                       Max = BMI;
                       y = a;
				}

             }
			if(22 == BMI)
				z = a;


       }
	  if(z != 0)
		  cout << z << endl;
	  else if(max == 0)
		  cout << y << endl;
	  else if(Max == 0)
		  cout << x << endl;

	  else if((22 - max) > (Max - 22))
               cout << y << endl;
           
	  else if((22 - max) < (Max - 22))
		  cout << x << endl;

          
	  else if((22 - max) == (Max - 22) && x > y)
      	  cout << y << endl;

          
	  else if((22 - max) == (Max - 22) && x < y)     
		  cout << x << endl;
		  

    }
 return 0;
}