#include "bits/stdc++.h"
using namespace std;

int main(){
    int n;
    int id;
    double height, weight;
    double diff;
    double best;
    int ans;
    while(cin >> n, n){
        best = 1000;
        for(int i=0; i< n; i++){
            cin >> id >> height >> weight;
            diff = abs(22 - weight / pow(height/100, 2));

            if(diff < best){
                best = diff;
                ans = id;
            }
        }
        cout << ans << endl;
    }

}