N = int(input()) total = int(input()) A = list(map(int, input().split())) dp = [[0 for _ in range(total + 1)] for _ in range(N + 1)] dp[N][total] = 1 for i in range(N - 1, -1, -1): for j in range(total + 1): if j + A[i] <= total and dp[i + 1][j + A[i]] == 1: dp[i][j] = 1 if j * A[i] <= total and dp[i + 1][j * A[i]] == 1: dp[i][j] = 1 j = A[0] ans = '' for i in range(1, N): if j + A[i] <= total and dp[i + 1][j + A[i]] == 1: ans += '+' j += A[i] continue if j * A[i] <= total and dp[i + 1][j * A[i]] == 1: ans += '*' j *= A[i] print(ans)