#include <iostream>
#include <cmath>

using namespace std;

struct Human {
    int id, w;
    double h, bmi;
    void setter(int _id, int _w, double _h) {
        id = _id;
        w = _w;
        h = _h / 100.0;
        bmi = w / h / h;        
    }
};
bool operator <(const Human &a, const Human &b)
{
    return abs(22 - a.bmi) != abs(22 - b.bmi) ? abs(22 - a.bmi) < abs(22 - b.bmi) : a.id < b.id;
}

int main()
{
    int n;
    int id, h, w;

    while (cin >> n, n) {
        Human ans, tmp;

        cin >> id >> h >> w;
        ans.setter(id, w, h);

        for (int i = 0; i < n - 1; i++) {
            cin >> id >> h >> w;
            tmp.setter(id, w, h);

            if (tmp < ans)
                ans = tmp;
        }
        cout << ans.id << endl;
    }

    return 0;
}