#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		if(n==0)break;
		double mindif;
		vector<int> ids,hs,ws;
		for(int i=0,id,h,w;i<n;++i){
			cin>>id>>h>>w;
			ids.push_back(id);
			hs.push_back(h);
			ws.push_back(w);
		}
		int ans;
		for(int i=n-1;i>=0;--i){
			double bmi=(double)ws[i]*10000/(double)(hs[i]*hs[i]);
			if(i==n-1||mindif>abs(22.0-bmi)){
				mindif=abs(22.0-bmi);
				ans=ids[i];
			}
		}
		cout<<ans<<"\n";
	}
}