object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val a = List.fill(sc.nextInt())(sc.nextDouble()).zipWithIndex
  val average = a.map(_._1).sum / a.length
  val (_, i) = a.minBy(i => (average - i._1).abs)
  println(i)
}
