
object Main extends App {

  import scala.io.StdIn._
  solve
  def solve: Unit = {
    val n = readLine.trim.toInt
    if (n != 0){
      println(Array.tabulate(n){_ ⇒
        val Array(p, h, w) = readLine.trim.split(' ').map(_.toInt)
        Person(p, h, w)
      }.sortWith{
        case (a, b) if math.abs(22 - a.bmi) != math.abs(22 - b.bmi) ⇒ math.abs(22 - a.bmi) < math.abs(22 - b.bmi)
        case (a, b) ⇒ a.id < b.id
      }.head.id
      )
      solve
    }
  }
  case class Person(id: Int, height: Double, weight:Double) {
    def bmi: Double = weight / height / height * 10000
  }
  implicit class ScopeFunc[T](val value:T){
    def let[A](func: T ⇒ A): A = func(value)
  }
}
