#include <iostream>
#include <algorithm>

using namespace std;

double abs(double a){
    if(a>0)return a;
    else return -a;
}
double bmi(double height,double weight){
    return 10000 * weight / (height*height);
}

int solve(int n){
    float ma = -1;
    int mai = -1;
    for(int i=0;i<n;i++){
        int a;
        double h,w;
        cin >> a >> h >> w;
        double b = bmi(h,w);
        if((abs(ma-22) == abs(b-22)) && a < mai){ mai = a; ma = b;}
        if(abs(ma-22) > abs(b-22)){ mai = a;ma = b;}
    }
    return mai;
}

int main(){
    int n;
    while(cin >> n && n != 0){
        cout << solve(n) << endl;
    }
}