#include <iostream>
#include <float.h>
#include <cmath>
using namespace std;

int main() {
	
	double ideal = 22;
	double min = DBL_MAX;
	int minId=1000000;
	
	int n;
	
	float id;
	float hght;
	float wght;
	
	double BMI;
	
	
	while(cin>>n,n){
		
		min = DBL_MAX;
		
		for(int i=0;i<n;++i){
			cin >> id >> hght >> wght;
			BMI = wght / (hght*hght) * 10000;
			
			if(fabs(BMI-ideal) < min){min=fabs(BMI-ideal);minId=id;}
			else if(fabs(BMI-ideal) == min){
				if(id<minId){
					min=fabs(BMI-ideal);
					minId=id;
				}
			}
		}
		cout << minId << endl;
	}
	
	return 0;
}