// AOJ 0159
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;

int main(void)
{
	int n;
	while (cin >> n, n){
		vector < pair <double, int> > d;
		double h, w;
		int id;
		for (int i = 0; i < n; i++){
			cin >> id >> h >> w;
			h /= 100.0;
			double bmi = w / (h * h);
			d.push_back(make_pair(abs(bmi - 22.0), id));
		}
		sort(d.begin(), d.end());
		// for (int i = 0; i < n; i++){
		// 	cout << d[i].first << " " << d[i].second << endl;
		// }
		cout << d[0].second << endl;
	}

	return 0;
}