n = int(input()) t = int(input()) a = list(map(int, input().split())) dp = [[0 for i in range(t+1)] for j in range(n+1)] dp[1][a[0]] = 1 for i in range(1, n): for j in range(t+1): if dp[i][j] != 0: x = j + a[i] if x <= t: dp[i+1][x] = dp[i][j] x = j * a[i] if x <= t: dp[i+1][x] = dp[i][j] ans = str() for i in reversed(range(1, n)): if dp[i][t - a[i]] == 1: ans += '+' t -= a[i] else: ans += '*' t //= a[i] print(ans[::-1])