# frozen_string_literal: true

n = gets.to_f
a = gets.split.map(&:to_i)
mean = a.inject(:+) / n
min = (a.shift - mean).abs
ret = 0

a.each_with_index do |e, idx|
  d = (e - mean).abs
  if min > d
    min = d
    ret = idx + 1
  end
end

puts ret