# include using namespace std; typedef long long ll; # define int long long # define lc u << 1 # define rc u << 1 | 1 # define fi first # define se second const int N = 25; int n; int a[N]; int x, y, z; bool dfs (int S) { for (int i = 0; i < n; i ++ ) { for (int j = i + 1; j < n; j ++ ) { for (int k = j + 1; k < n; k ++ ) { if (~S & (1 << i) && ~S & (1 << j) && ~S & (1 << k)) { if ((a[i] > a[j] && a[j] < a[k] && a[i] != a[k]) || (a[i] < a[j] && a[j] > a[k] && a[i] != a[k])) { if (!dfs (S ^ (1 << i) ^ (1 << j) ^ (1 << k))) { x = i, y = j, z = k; return 1; } } } } } } return 0; } signed main () { // freopen ("game.in", "r", stdin); freopen ("game.out", "w", stdout); scanf ("%lld", &n); for (int i = 0; i < n; i ++ ) scanf ("%lld", &a[i]); if (dfs (0)) printf ("%lld %lld %lld\n", x, y, z); else printf ("-1\n"); return 0; }