#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define all(x) (x).begin(),(x).end() #define rep(i,m,n) for(int i = m;i < n;++i) #define pb push_back #define fore(i,a) for(auto &i:a) #define rrep(i,m,n) for(int i = m;i >= n;--i) #define INF INT_MAX/2 using namespace std; using ll = long long; using R = double; const ll MOD = 1e9 + 7; const ll inf = 1LL << 50; struct edge { ll from; ll to; ll cost; }; int n; vectork; vectorans; int memo[1 << 12][2]; int check(int a,int b,int c) { if (b > a && b > c)return 1; else return 0; } int dfs(int used,int turn) { if (memo[used][turn] != -1)return memo[used][turn]; int winner = 1 - turn; rep(p, 0, n)rep(q, p+1, n)rep(r, q+1, n) { if (!(used & (1 << p)) && !(used & (1 << q)) && !(used & (1 << r))) { if ((k[p] != k[q] && k[q] != k[r] && k[r] != k[p]) && check(k[p],k[q],k[r])) { int tmp = used; tmp += (1 << p) + (1 << q) + (1 << r); if (dfs(tmp, 1 - turn) == turn) { winner = turn; if (used == 0 && turn == 0) { ans.pb(p), ans.pb(q), ans.pb(r); } break; } } } } return memo[used][turn] = winner; } int main(){ cin >> n; rep(i, 0, n) { int K; cin >> K; k.pb(K); } memset(memo, -1, sizeof(memo)); if (dfs(0, 0) == 1)cout << -1 << endl; else { rep(i, 0, 3) { if (i)cout << " "; cout << ans[i]; } cout << endl; } return 0; }