#include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

double bmi(double a, double b){
    return a / b / b;
}

int main(){
    int n, num;
    while(cin >> n, n){
        double m, kg;
        double ans = 2 << 24, ansmbi = 2 << 24;
        rep(i, n){
            cin >> num >> m >> kg;
            double re = fabs(bmi(kg, m / 100) - 22);
            if(ansmbi > re || (ansmbi == re && ans > num)){
                ansmbi = re;
                ans = num;
            }
        }
        cout << ans << endl;
    }
}