N=int(input())
T=int(input())
A=list(map(int,input().split()))

last=N//2

ANS=[A[0]]

for i in range(1,last+1):
    NANS=[]
    for ans in ANS:
        NANS.append(ans+A[i])
        NANS.append(ans*A[i])
    ANS=NANS



ANS2=[T]
for i in range(N-1,last,-1):
    NANS2=[]
    for ans in ANS2:
        NANS2.append(ans-A[i])
        if ans%A[i]==0:
            NANS2.append(ans//A[i])
        else:
            NANS2.append(-1)
    ANS2=NANS2


SET=set(ANS2)

for i in range(len(ANS)):
    if ANS[i] in SET:
        for j in range(len(ANS2)):
            if ANS[i]==ANS2[j]:
                S=bin(i)[2:].zfill(N//2)+bin(j)[2:].zfill(N-N//2-1)
                for s in S:
                    if s=="0":
                        print("+",end="")
                    else:
                        print("*",end="")
                exit()