#include #include #include #include #include using namespace std; typedef pair pii; int N; int W[101], sum[101]; vector dp[101]; string ans = "impossible"; int main(void) { cin >> N; dp[0].push_back(pii(0, 0)); for (int n = 1; n <= N; ++n) cin >> W[n]; sum[1] = accumulate(W + 1, W + N + 1, 0); for (int n = 2; n <= N; ++n) { sum[n] = sum[n - 1] - W[n - 1]; } for (int n = 1; n <= N; ++n) { for (size_t idx = 0U; idx < dp[n - 1].size(); ++idx) { pii pre = dp[n - 1][idx]; if (abs(pre.first + W[n] - pre.second) <= sum[n]) dp[n].push_back(pii(pre.first + W[n], pre.second)); if (abs(pre.first - (pre.second + W[n])) <= sum[n]) dp[n].push_back(pii(pre.first, pre.second + W[n])); } } for (size_t idx = 0U; idx < dp[N].size(); ++idx) { if (dp[N][idx].first == dp[N][idx].second) ans = "possible"; } cout << ans << endl; return 0; }