#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){
	
	while(true){
		
		int n;
		
		cin >> n;
		
		if(n == 0){
			break;
		}
		
		int ans = 100000000;
		double BMI = 100000000;
		
		for(int loop = 0; loop < n; loop++){
			double p, h, w;
			cin >> p >> h >> w;
			h /= 100;
			//cout << w / h / h << endl;
			if(abs(22 - w / h / h) < abs(22 - BMI)){
				ans = p;
				BMI = w / h / h;
			}else if(abs(22 - w / h / h) == abs(22 - BMI)){
				if(p < ans){
					ans = p;
				}
			}
		}
		
		cout << ans << endl;
		
	}
	return 0;
}