#include #include #include #include using namespace std; int main() { int N; cin >> N; vector W(N); for(int i = 0 ; i < N; i++ ){ cin >> W[i]; } sort( W.begin(), W.end() ); int half = 0; for( auto x: W ) { half += x; } if( half%2 == 1 ) { cout << "impossible" << endl; return 0; } half = half / 2; // cout << "half " << half << endl; stack s; int sum =0; int i = 0; while( 1 ) { if( i >= N ) { int sss; while( !s.empty() ) { i = s.top(); s.pop(); } if( i == N ) { cout << "impossible" << endl; return 0; } sum = 0; i++; } else if( half == sum + W[i] ) { cout << "possible" << endl; while( s.empty() ) { cout << s.top() << endl; s.pop(); } return 0; } else if( half > sum + W[i] ) { sum += W[i]; s.push( i ); i++; } else if( half < sum + W[i] ) { if( s.empty() ) { cout << "impossible" << endl; return 0; } i= s.top(); sum -= W[i]; i++; s.pop(); } else { cout << "arienai" << endl; return 0; } } return 0; }