require 'bigdecimal'
n = gets.to_i
bmi1 = 22
until n == 0
    resou = 1000.0
    id = 1001
    n.times do
        x = gets.split(" ").map{|k| k.to_f }
        height = x[1] * x[1] / 10000
        weight = x[2]
        bmi = BigDecimal(weight.to_s) / BigDecimal(height.to_s)
        bmi.to_i
        num = (bmi1 - bmi).abs
        if resou > num
            resou = num
            id = x[0]
        elsif resou < num
        elsif resou == num
            if id > x[0]
                id = x[0]
            end
        end 
    end
    puts id.to_i
    n = gets.to_i
end
