#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define mp make_pair #define mt make_tuple #define pb push_back #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair pii; const int INF = 1 << 29; const double EPS = 1e-9; const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1}; int N; int dp[110][2500]; vector weight; int memo(int pos, int sum) { if (pos == N) { if (sum == 1250) { return 1; } else { return 0; } } if (dp[pos][sum] >= 0) { return dp[pos][sum]; } int res = 0; res |= memo(pos + 1, sum + weight[pos]); res |= memo(pos + 1, sum - weight[pos]); return dp[pos][sum] = res; } int main() { int pos = 1250; memset(dp, -1, sizeof(dp)); cin >> N; for (int i = 0; i < N; i++) { int x; cin >> x; weight.push_back(x); } if (memo(0, pos) == 1) { cout << "possible" << endl; } else { cout << "impossible" << endl; } return 0; }