from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

N  = int(input())
T = int(input())
A = list(map(int,input().split()))
INF = (1<<60)-1
dp = [[INF]*(T+2) for _ in range(N)]
a = A[0]
dp[0][a] = 1
for i in range(N-1):
    a = A[i+1]
    
    for j in range(T+1):
        
        if dp[i][j]==INF:
            continue
        
        dp[i+1][min(j+a,T+1)] = min(dp[i+1][min(j+a,T+1)],dp[i][j]<<1)
        dp[i+1][min(j*a,T+1)] = min(dp[i+1][min(j*a,T+1)],(dp[i][j]<<1)+1)


ans = []
now = T
target = dp[-1][T]
for i in range(N-1):
    if (target>>i)&1:
        ans.append('*')
    else:
        ans.append('+')
ans.reverse()
print(*ans,sep='')