import sys sys.setrecursionlimit(10**7) def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) N = I() total = I() A = LI() dp0 = [[0]*(total+1) for _ in range(N)] dp0[0][A[0]] = 1 for i in range(1,N): a = A[i] for j in range(1,total+1): if j >= a: dp0[i][j] |= dp0[i-1][j-a] if j % a == 0: dp0[i][j] |= dp0[i-1][j//a] dp1 = [[0]*(total+1) for _ in range(N)] dp1[-1][-1] = 1 for i in range(N-2,-1,-1): a = A[i+1] for j in range(1,total+1): if j+a <= total and dp1[i+1][j+a]: dp1[i][j] = 1 elif j*a <= total and dp1[i+1][j*a]: dp1[i][j] = 1 ans = '' x = A[0] for i in range(1,N): a = A[i] if x+a <= total and dp1[i][x+a]: ans += '+' x += a else: ans += '*' x *= a print(ans)