import java.util.*; public class Main_yukicoder10 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int total = sc.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } boolean[][] dp = new boolean[n][total + 1]; dp[n - 1][total] = true; for (int j = n - 1; j > 0; j--) { for (int i = 1; i <= total; i++) { if (i * a[j] <= total && dp[j][i * a[j]]) { dp[j - 1][i] = true; } if (i + a[j] <= total && dp[j][i + a[j]]) { dp[j - 1][i] = true; } } } String ret = ""; int j = a[0]; for (int i = 1; i < n; i++) { if (j + a[i] <= total && dp[i][j + a[i]]) { ret += "+"; j += a[i]; } else if (j * a[i] <= total && dp[i][j * a[i]]){ ret += "*"; j *= a[i]; } else { System.out.println("error"); } } System.out.println(ret); sc.close(); } }