#include <iostream>
#include <cmath>
using namespace std;

class humman
{
public:
	double id, h, w;
	humman(int n, int high, int weight)
	{
		id = n;
		h = high / 100.0;
		w = weight;
	}
	double bmi()
	{
		return w / (h * h);
	}
};

int main()
{
	int n;
	while (true)
	{
		cin >> n;
		if (n == 0) break;
		humman nearest(-1, 1, 0xFFFFFF);
		for (int i = 0; i < n; i++)
		{
			int id, w, h;
			cin >> id >> w >> h;
			humman a(id, w, h);
			if (abs(22.0 - a.bmi()) < abs(22.0 - nearest.bmi()))
			{
				nearest = a;
			}
		}
		cout << nearest.id << endl;
	}
	return 0;
}