import java.io.*; import java.util.*; import java.util.stream.*; public class Main { static long[][] dp; static int[] values; static int[] sums; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int total = sc.nextInt(); values = new int[n]; sums = new int[n]; for (int i = 0; i < n; i++) { values[i] = sc.nextInt(); if (i == 0) { sums[i] = values[i]; } else { sums[i] = sums[i - 1] + values[i]; } } dp = new long[n][total + 1]; for (long[] arr : dp) { Arrays.fill(arr, Long.MIN_VALUE); } long x = dfw(n - 1, total); String[] OPE = new String[]{"+", "*"}; StringBuilder sb = new StringBuilder(); for (int i = 0; i < n - 1; i++) { sb.append(OPE[(int)(x % 2)]); x >>= 1; } System.out.println(sb.reverse()); } static long dfw(int idx, int v) { if (v == sums[idx]) { return 0; } if (idx == 0) { return -1; } if (dp[idx][v] == Long.MIN_VALUE) { long a = -1; if (v % values[idx] == 0) { a = dfw(idx - 1, v / values[idx]); } long b = dfw(idx - 1, v - values[idx]); if (a < 0) { dp[idx][v] = b * 10; } else { if (b < 0 || a < b) { dp[idx][v] = a * 10 + 1; } else { dp[idx][v] = b * 10; } } } return dp[idx][v]; } } class Utilities { static String arrayToLineString(Object[] arr) { return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n")); } static String arrayToLineString(int[] arr) { return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new)); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public int[] nextIntArray() throws Exception { return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }