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) { if (n % 2 == 1) return false; auto m = n / 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]; } writeln(dp); } return dp[m]; }