import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int t = sc.nextInt(); int[] a = new int[n]; for(int i = 0; i < n; i++) { a[i] = sc.nextInt(); } int[][] dp = new int[n + 1][t + 1]; String[][] exp = new String[n + 1][t + 1]; dp[1][a[0]] = 1; exp[1][a[0]] = ""; if(a[0] + a[1] < t + 1) { dp[2][a[0] + a[1]] = 1; exp[2][a[0] + a[1]] = "1"; } if(a[0] * a[1] < t + 1) { dp[2][a[0] * a[1]] = 1; if(a[0] * a[1] != a[0] + a[1]) { exp[2][a[0] * a[1]] = "2"; } } for(int i = 3; i < n + 1; i++) { for(int j = 1; j < t + 1; j++) { int x = 0; int y = 0; if(j > a[i - 1]) { if(dp[i - 1][j - a[i - 1]] == 1) { dp[i][j] = 1; x = Integer.parseInt(exp[i - 1][j - a[i - 1]]); } if(dp[i - 1][j / a[i - 1]] == 1) { dp[i][j] = 1; y = Integer.parseInt(exp[i - 1][j / a[i - 1]]); } if(x > 0 && y > 0) { if(x <= y) { exp[i][j] = exp[i - 1][j - a[i - 1]] + "1"; } else { exp[i][j] = exp[i - 1][j / a[i - 1]] + "2"; } } if(x > 0 && y == 0) { exp[i][j] = exp[i - 1][j - a[i - 1]] + "1"; } if(x == 0 && y > 0) { exp[i][j] = exp[i - 1][j / a[i - 1]] + "2"; } } else { if(j % a[i - 1] == 0) { if(dp[i - 1][j / a[i - 1]] == 1) { dp[i][j] = 1; exp[i][j] = exp[i - 1][j / a[i - 1]] + "2"; } } } } } String e = exp[n][t]; String ans = ""; for(int i = 0; i < e.length(); i++) { if(e.charAt(i) == '1') { ans += "+"; } else { ans += "*"; } } System.out.println(ans); } }