#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;

double bmi(double w, double m){
  return w / m / m;
}

int main(){
  int n;

  while(cin >> n, n){
    int ans = -1;
    double minDiff = 999999999;

    for(int i = 0; i < n; i++){
      int num, h, w;
      cin >> num >> h >> w;

      double b = fabs(bmi(w, h / 100.0) - 22.0);

      if(minDiff > b || minDiff == b && ans > num){
        ans = num;
        minDiff = b;
      }
    }

    cout << ans << endl;
  }
}