import future, math, strutils


proc nextString: string =
   result = ""
   while not endOfFile stdin:
      let nextChar = readChar stdin
      case nextChar
      of '\r':
         discard
      of "\n"[0], ' ':
         break
      else:
         add result, nextChar


proc nextInt: int =
   return parseInt nextString()


proc main: void =
   let n = nextInt()
   let a = lc[nextInt() | (x <- 0..<n), int]
   let ave = a.sum.toFloat / n.toFloat

   var k = 0
   var v = float.high

   for i, ai in a:
      let tmp = abs(ave - ai.toFloat)
      if v > tmp:
         k = i
         v = tmp
   
   echo k

when isMainModule:
   main()
