def abs(n)
  0 < n ? n : -n
end

while n = gets.to_i
  break if n.zero?

  bmi_standard = 22
  id = h = w = 0
  bmi = 50
  n.times do
    _id, _h, _w = gets.split.map(&:to_i)
    _bmi = _w / ((_h/100.0)*(_h/100.0))
    if abs(22-_bmi) < abs(22-bmi)
      id, bmi = _id, _bmi
    elsif abs(22-bmi) == abs(22-_bmi) && _id < id
      id = _id
    end
  end

  puts id
end