#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){
    int bw=0,bh=0,bi=100000000;
    double bbmi = -1;
    for(int i=0;i<n;i++){
        int ind,w,h;
        cin >> ind >> h >> w;
        double te = bmi(h,w);
        if(bh*bh*w == h*h*bw && bi > ind){
            bi = ind;bbmi = te;bw=w;bh=h;
        }else if(abs(bbmi-22) > abs(te-22)){
            bi = ind;bbmi = te;bw=w;bh=h;
        }
    }
    return bi;
}

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