try:
    while 1:
        N = int(input())
        l = list(map(int, input().split()))
        if N <= 2:
            print (1)
            continue
        diff = l[N-1]-l[N-2]
        done = True
        for i in range(N-1,0,-1):
            if l[i]-l[i-1] != diff:
               print(i+1)
               done = False
               break
        if done:
            print(1)
except EOFError:
    pass
                
