n = int(input())
a = list(map(int, input().split()))
r = sum(a) / n
m = 10000
ans = 0
for i in range(n):
    if m > abs(a[i] - r):
        m = abs(a[i] - r)
        ans = i
print(ans)

49f2fb50a1daff7d6a81c2bb644a7cb4b1732154
<mask token>

<mask token>
for i in range(n):
    if m > abs(a[i] - r):
        m = abs(a[i] - r)
        ans = i
print(ans)

n = int(input())
a = list(map(int, input().split()))
r = sum(a) / n
m = 10000
ans = 0
for i in range(n):
    if m > abs(a[i] - r):
        m = abs(a[i] - r)
        ans = i
print(ans)
