N = int(input()) K = list(map(int, input().split())) def dfs(LIST): # LISTの盤面で手番の人が勝つなら勝つ手、負けるなら0 L = len(LIST) for i in range(L): for j in range(i+1, L): for k in range(j+1, L): if len(set(LIST)) != L: continue hand = [LIST[i], LIST[j], LIST[k]] if max(hand) == LIST[j] or min(hand) == LIST[j]: new_LIST = [] for l in range(L): if l != i and l != j and l != k: new_LIST.append(LIST[l]) if dfs(new_LIST) == 0: return [i, j, k] return 0 result = dfs(K) if result == 0: print(-1) else: print(*result)