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 n = readln.chomp.to!size_t; auto t = readln.chomp.to!int; auto ai = readln.split.map!(to!int); auto memo = new string[][](n, t + 1); string rec(int s, string ops) { auto i = ops.length; if (s > t) return "E"; if (i == n - 1) return s == t ? ops : "E"; if (memo[i][s] != "") return memo[i][s]; auto a = ai[i + 1]; auto r1 = rec(s + a, ops ~ "+"); if (r1 != "E") return memo[i][s] = r1; auto r2 = rec(s * a, ops ~ "*"); if (r2 != "E") return memo[i][s] = r2; return memo[i][s] = "E"; } writeln(rec(ai[0], "")); }