#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define sz size() #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #define rep(i,a,b) for(int i=(a);i<(b);++i) #define clr(a, b) memset((a), (b) ,sizeof(a)) #define MOD 1000000007 int n; vector v; int d[30]; int isKadomatsu(int a, int b, int c){ if((ac)||(a>b&&ab)||(c>a&&c v1; rep(i,0,n){ if(d[i]==0){ v1.pb(i); } } // 0 if(c == 0){ int ret = 1; rep(i,0,v1.sz){ rep(j,i+1,v1.sz){ rep(k,j+1,v1.sz){ if(1==isKadomatsu(v[v1[i]],v[v1[j]],v[v1[k]])){ d[v1[i]]=1;d[v1[j]]=1;d[v1[k]]=1; ret &= f(d,1-c); d[v1[i]]=0;d[v1[j]]=0;d[v1[k]]=0; } } } } return ret; } // 1 else{ int ret = 0; rep(i,0,v1.sz){ rep(j,i+1,v1.sz){ rep(k,j+1,v1.sz){ if(1==isKadomatsu(v[v1[i]],v[v1[j]],v[v1[k]])){ d[v1[i]]=1;d[v1[j]]=1;d[v1[k]]=1; ret |= f(d,1-c); d[v1[i]]=0;d[v1[j]]=0;d[v1[k]]=0; } } } } return ret; } } int main(){ cin>>n; rep(i,0,n){ int a; cin>>a; v.pb(a); } clr(d,0); rep(a,0,n){ rep(b,a+1,n){ rep(c,b+1,n){ if(1==isKadomatsu(v[a],v[b],v[c])){ d[a]=1;d[b]=1;d[c]=1; if(0==f(d,1)){ cout << a << " " << b << " " << c << endl; return 0; } d[a]=0;d[b]=0;d[c]=0; } } } } cout << -1 << endl; return 0; }