#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int, int> P;

int main() {
    while (true) {
        int n;
        cin >> n;
        if (n == 0) break;

        int ans = n+1;
        double dif = 1<<19;
        rep(i, n) {
            int p;
            double h, w;
            cin >> p >> h >> w;
            double bmi = 10000*w/h/h;
            if (dif >= abs(bmi-22)) {
                if (dif == abs(bmi-22)) ans = min(ans, p);
                else ans = p;
                dif = abs(bmi-22);
            }
        }

        cout << ans << endl;
    }

    return 0;
}
