import sys from itertools import combinations def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None def is_kadomatu(a): return a[0] != a[2] and (a[0] - a[1])*(a[2] - a[1]) > 0 def can_win(N, K): for i, j, k in combinations(range(N), 3): if is_kadomatu([K[i], K[j], K[k]]): K1 = K[:i] + K[i + 1:j] + K[j + 1:k] + K[k + 1:] if can_win(N - 3, K1) == (-1,): return i, j, k return (-1,) def solve(): N = int(input()) K = [int(i) for i in input().split()] ans = can_win(N, K) print(*ans) if __name__ == '__main__': solve()