from statistics import mean
import math
n = int(input())
a = list(map(int, input().split()))

m = mean(a)
Min = math.fabs(a[0]-m)
ret = []

for i in range(1, len(a)):
    if math.fabs(a[i]-m) < Min:
        Min = math.fabs(a[i]-m)
        ret.append(i)
        print(math.fabs(a[i]-m))

print(ret)

if len(ret) > 0:
    print(ret[-1])
else:
    print(0)