import std.algorithm, std.array, std.container, std.range; import std.string, std.conv, std.math; import std.stdio, std.typecons; void main() { auto n = readln.chomp.to!int; auto wi = readln.split.map!(to!int).array; writeln(calc(n, wi) ? "possible" : "impossible"); } bool calc(int n, int[] wi) { auto sum = reduce!("a + b")(0, wi); if (sum % 2 == 1) return false; auto m = sum / 2; auto dp = new bool[m + 1]; dp[0] = true; foreach (w; wi) { for (auto i = m; i >= w; --i) { dp[i] = dp[i] || dp[i - w]; } } return dp[m]; }