#include <iostream>
#include <vector>
#include <math.h>

using namespace std;
typedef pair<int, double> P;

void solve()
{
	int n;
	while(cin >> n, n)
	{
		double min_BMI = 99999999;
		vector<P> data;
		for(int i = 0; i < n; ++i)
		{
			int a;
			cin >> a;
			double h, w;
			cin >> h >> w;
			double BMI = 10000 * w / (h * h);
			data.push_back(P(a, fabs(22 - BMI)));
			if(fabs(22 - BMI) < min_BMI)
			{
				min_BMI = fabs(22 - BMI);
			}
		}
		int min_number = 999999999;
		for(int i = 0; i < n; ++i)
		{
			if(data[i].second == min_BMI)
			{
				if(data[i].first < min_number)
				{
					min_number = data[i].first;
				}
			}
		}
		cout << min_number << endl;
	}
}

int main()
{
	solve();
	return(0);
}