#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>
#include <complex>


typedef long long ll;
const double Eps = 1e-4;
bool eq(double a, double b)
{
	return abs(a - b) < Eps;
}

using namespace std;

int main()
{
	int n;
	while (scanf("%d", &n), n)
	{
		double ideal = 10000;
		int ans = 100000000;
		while (n--)
		{
			int i, h, w;
			scanf("%d %d %d", &i, &h, &w);
			double t = abs(w / (h*h*0.0001) - 22);
			if (t < ideal || eq(ideal, t) && i < ans)
			{
				ideal = t;
				ans = i;
			}
		}
		printf("%d\n", ans);
	}

	return 0;
}