using System; using System.Linq; namespace No._10 { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int a = int.Parse(Console.ReadLine()); int[] d = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray(); calc(n, a, d, 1, d[0], ""); } static bool calc(int n, int a, int[] d, int l, int s, string o) { if (n == l) { if (s == a) { Console.WriteLine(o); return true; } } else if (s + d[l] > a) { return false; } else { if (calc(n, a, d, l + 1, s + d[l], o + "+")) return true; if (calc(n, a, d, l + 1, s * d[l], o + "*")) return true; } return false; } } }