n = gets.to_i
a = gets.split.map(&:to_i)
sum = a.inject(:+)
min_diff = 10000
min_diff_i = -1
a.each_with_index do |v, i|
  diff = (v * n - sum).abs
  if diff < min_diff
    min_diff = diff
    min_diff_i = i
  end
end
puts min_diff_i
