from collections import defaultdict import heapq inf = 10 ** 18 N = int(input()) total = int(input()) A = list(map(int, input().split())) dist = defaultdict(lambda: inf) prev = defaultdict(lambda: -1) dist[(A[0], 1)] = 0 que = [(0, A[0], 1)] # cost, total, index while que: ds, s, i = heapq.heappop(que) if dist[s] < s: continue if i == N: if s == total: break continue t = s + A[i] if t <= total and dist[(t, i + 1)] > ds: heapq.heappush(que, (ds, t, i + 1)) prev[(t, i + 1)] = s t = s * A[i] if t <= total and dist[(t, i + 1)] > ds + (1 << i): heapq.heappush(que, (ds + (1 << i), t, i + 1)) prev[(t, i + 1)] = s ans = [] for i in range(N - 1): s = prev[(total, N - i)] if s + A[N - 1 - i] == total: ans.append("+") else: ans.append("*") total = s print("".join(ans[::-1]))