object Main extends App {
  import scala.io.StdIn._


  val n = readInt
  val frames = readLine.trim.split(' ').map(_.toInt)
  println(frames.indices.minBy{i ⇒ math.abs(frames(i) * n - frames.sum)})
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline
    def also(@inline func: T ⇒ Unit): T = {
      func(value)
      value
    }
    @inline
    def let[A](@inline func: T ⇒ A): A = func(value)
  }
}