N = gets.to_i
as = gets.split.map(&:to_f)
avg = as.inject(:+) / N

ans = -1
dist = 10 ** 20
as.each_with_index do |a,i |
  if dist > (a - avg).abs
    ans = i
    dist = (a - avg).abs
  end
end
puts ans