import std.algorithm, std.array, std.container, std.range, std.bitmanip; import std.numeric, std.math, std.bigint, std.random, core.bitop; import std.string, std.regex, std.conv, std.stdio, std.typecons; void main() { auto rd = readln.split; auto n = rd[0].to!size_t, s = rd[1].to!int; auto pi = iota(n).map!(_ => readln.chomp.to!int).array; if (n == 1) { if (pi[0] == s) writeln(1); else writeln(-1); return; } auto m1 = n / 2; auto m2 = n - m1; size_t[][int] hi; foreach (i; 0..1 << m2) { auto u = i.bitsSet.map!(j => pi[j + m1]).sum; hi[u] ~= i; } size_t[] ri; foreach (i; 0..1 << m1) { auto u = i.bitsSet.map!(j => pi[j]).sum; auto w = s - u; if (w < 0 || !(w in hi)) continue; ri ~= hi[w].map!(x => (x << m1) | i).array; } if (ri.empty) { writeln(-1); } else { auto ri2 = ri.map!(r => r.bitsSet.array).array; ri2.sort(); ri2.each!(r => writeln(r.map!("a + 1").map!(to!string).join(" "))); } }