#include #include using namespace std; int n; vector w; int weightSum = 0; int weightSumHalf; bool traverse(int position, int sum) { sum += w[position]; if (sum < weightSumHalf) { for (int i = position + 1; i < n; ++i) { if (traverse(i, sum)) { return true; } } return false; } else if (sum > weightSumHalf) { return false; } else { return true; } } int main(int argc, char* argv[]) { cin >> n; w.resize(n); for (int i = 0; i < n; ++i) { cin >> w[i]; weightSum += w[i]; } if (weightSum % 2 == 1) { cout << "impossible" << endl; return 0; } weightSumHalf = weightSum / 2; if (traverse(0, 0)) { cout << "possible" << endl; } else { cout << "impossible" << endl; } return 0; }