var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
var n=0;
var obj={};
var abc=[];
for(var i=0;i<Arr.length;i++){
   if(n==0){
      if(i!=0){
         abc.sort(function(a,b){return a-b;});
         for(var k in obj){
            if(obj[k]==abc[0]){console.log(k);break;}
         }
      }
      if(Arr[i]==0)break;
      n=Arr[i];
      abc=[];
      obj={};
    }else{
      n--;
      var arr=Arr[i].split(" ").map(Number);
      var h=arr[1]/100;
      var bmi=Math.abs(22-arr[2]/(h*h));
      abc.push(bmi);
      obj[arr[0]]=bmi;
   }
}