#include <cstdio>
#include <cmath>
#include <map>
#define mp make_pair
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
int main()
{
	while (true) {
		int n; scanf("%d", &n); if (n == 0) break;
		pair<double, int> best = mp(99999999, 99999999);
		rep(i, n) {
			int k, h, w; scanf("%d%d%d", &k, &h, &w);
			double bmi = 10000 * w / ((double)h * h);
			pair<double, int> t = mp(fabs(22.0 - bmi), k);
			if (best > t) best = t;
		}
		printf("%d\n", best.second);
	}
	return 0;
}