import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import itertools N,*K = map(int,read().split()) def F(K): """勝てるなら、Trueとその初手 負けるなら、Falseを返す""" for i,j,k in itertools.combinations(range(len(K)),3): is_kadomatsu = (K[i] > K[j] < K[k]) or (K[i] < K[j] > K[k]) if not is_kadomatsu: continue newK = [x for ind,x in enumerate(K) if ind not in [i,j,k]] result = F(newK) if not result: return True, (i,j,k) return False result = F(K) if result: print(*result[1]) else: print(-1)