def point_ex(s): k=0 arr=[] if s[0]!=s[1]: arr.append(0) if s[-1]!=s[-2]: arr.append(len(s)-1) for i in s[1:len(s)-1]: if s[k]<i and s[k+2]<i or s[k]>i and s[k+2]>i: arr.append(k+1) k = k+1 p = sorted(arr) #u = "".join(p) for i in p: print(i,end=' ') print() while True: try: n = int(input()) s = list(map(int, input().split())) point_ex(s) except: break