Niwango-kun is an employee of Dwango Co., Ltd.   One day, he is asked to generate a thumbnail from a video a user submitted.   To generate a thumbnail, he needs to select a frame of the video according to the following procedure:    * Get an integer N and N integers a_0, a_1, ..., a_{N-1} as inputs. N denotes the number of the frames of the video, and each a_i denotes the representation of the i-th frame of the video.   * Select t-th frame whose representation a_t is nearest to the average of all frame representations.   * If there are multiple such frames, select the frame with the smallest index.  Find the index t of the frame he should select to generate a thumbnail.
n = int(input())
a = list(map(int,(input().split())))
tmp = [sum(a)/n for i in range(n)]
average = tmp[0]

x = []

for i in range(n):
    tmp1 = a[i] - average
    if tmp1 < 0:
        tmp1 = tmp1 * -1
    x.append(tmp1)

tmp2 = x[i]
counter = 0
for i in range(1,n-1):
    if tmp2 < x[i]:
        result = x.index(x[i])
    else:
        result = 0

hantei = set(x)
if len(hantei) == 1:
    print(0)
else:
    print(result)

n = int(input())
a = list(map(int, input().split()))
 
ave = sum(a) / n
hantei = 200000
ans = 0
for i, f in enumerate(a):
    if hantei > abs(ave - f):
        hantei = abs(ave - f)
        ans = i
 
print(ans)