#include <bits/stdc++.h>
using namespace std;

typedef vector<int> V;

V K;
map<V,bool> memo;
using namespace std;

bool solve(V& now){
    if(memo.count(now))return memo[now];
    int n=now.size();
    bool win=false;
    for(int a = 0; a < n; a++){
        if(now[a]<0)continue;
        for(int b=a+1; b <n; b++){
            if(now[b]<0)continue;
            for(int c=b+1; c <n; c++){
                if(now[c]<0||now[a]==now[c])continue;

                if((now[a]>now[b]&&now[c]>now[b])||(now[a]<now[b]&&now[c]<now[b])){
                    V m=now;
                    m[a]=m[b]=m[c]=-1;
                    if(solve(m)==false)win=true;
                }
            }
        }
    }
    return memo[now]=win;
}
int main() {
    int N;cin>>N;
    K.resize(N);
    for(auto& it : K)cin>>it;

    for(int a = 0; a < N; a++){
        for(int b=a+1; b <N; b++){
            for(int c=b+1; c <N; c++){
                if(K[a]!=K[c]&&((K[a]>K[b]&&K[c]>K[b])||(K[a]<K[b]&&K[c]<K[b]))){
                    V m=K;
                    m[a]=m[b]=m[c]=-1;
                    if(solve(m)==false){
                        cout<<a<<" "<<b<<" "<<c<<endl;
                        return 0;
                    }
                }
            }
        }
    }
    cout<<-1<<endl;
    return 0;
}