N = gets.to_i
str = gets.split
a = []
all = 0
for x in 0...N
  a[x] = str[x].to_i
  all += a[x]
end

ave = all / N.to_f

answer = 0
dif = (a[x] - ave).abs

for x in 1...N
  if dif > (a[x] - ave).abs
    answer = x
    dif = a[x] - ave
  end
end

puts(answer)