#include #include #include using namespace std; using i64 = long long; template class Range{private:struct I{T x;T operator*(){return x;}bool operator!=(I& lhs){return x; bool is_kado(int a, int b, int c) { return (a!=b&&b!=c&&c!=a) && ((a>b&&bc)); } int n; vector K; bool nya(bool is_bob) { bool res = false; for(auto&& a : range(n)) { for(auto&& b : range(a+1, n)) { for(auto&& c : range(b+1, n)) { int x = K[a], y = K[b], z = K[c]; if(!(x&&y&&z)) { continue; } if(!is_kado(x, y, z)) { continue; } K[a] = 0, K[b] = 0, K[c] = 0; res |= !nya(!is_bob); K[a] = x, K[b] = y, K[c] = z; } } } return res; } int main(void) { scanf("%d", &n); K.assign(n, 0); for(auto&& i : range(n)) { scanf("%d", &K[i]); } // puts(nya(0) ? "Yes" : "-1"); for(auto&& a : range(n)) { for(auto&& b : range(a+1, n)) { for(auto&& c : range(b+1, n)) { int x = K[a], y = K[b], z = K[c]; if(!(x&&y&&z)) { continue; } if(!is_kado(x, y, z)) { continue; } K[a] = 0, K[b] = 0, K[c] = 0; if(!nya(1)) { printf("%lld %lld %lld\n", a, b, c); return 0; } K[a] = x, K[b] = y, K[c] = z; } } } puts("-1"); return 0; }