#include #include #include #include int main() { int n = 0; std::cin >> n; std::stack buf; buf.push(0); for(int i = 0; i < n; ++i) { int tmp = 0; std::cin >> tmp; std::stack tmpbuf; while(!buf.empty()) { auto const a = buf.top(); //std::cout << "a:" << a << std::endl; buf.pop(); tmpbuf.push(tmp + a); tmpbuf.push(tmp - a); } buf = tmpbuf; } bool found = false; while(!buf.empty()) { if( buf.top() == 0 ) found = true; buf.pop(); } if( found ) std::cout << "possible" << std::endl; else std::cout << "impossible" << std::endl; }