#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; } half = half / 2; // cout << "half " << half << endl; stack s; int sum =0; int i = 0; while( 1 ) { if( i == N ) { if( s.empty() ) { cout << "impossible" << endl; return 0; } i = s.top(); i++; s.pop(); } 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] ) { i++; } } return 0; }