#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#define N 1000000
#define STD_BMI 22.000
#define EPS 1.0e-10
using namespace std;
struct Person{
	int id,h,w;
	double BMI;
	bool operator<(const Person &t)const{
		if( fabs(this->BMI-STD_BMI)<fabs(t.BMI-STD_BMI) ){
			return true;
		}else if( fabs( fabs(this->BMI-STD_BMI) - fabs(t.BMI-STD_BMI) ) < EPS ){
			return this->id < t.id;
		}
		return false;
	}
};
istream &operator>>(istream &is, Person &t){
	is>>t.id>>t.h>>t.w;
	t.BMI=t.w/((double)(t.h)*(t.h)/10000.0);
	return is;
}
int main(){
	while(true){
		int n;
		vector<Person> v;
		v.reserve(N);
		cin>>n;
		if(n==0)break;
		for(int i =0; i <n; ++i){
			Person t;
			cin>>t;
			v.push_back(t);
		}
		sort(v.begin(),v.end());
		cout<<v[0].id<<endl;
	}
	return 0;
}