n=int(input()) T=int(input()) a=list(map(int,input().split())) X=1<<60 q=[X]*(T+1) q[a[0]]=0 for v in a[1:]: nq=[X]*(T+1) for i in range(T+1): if i+v<=T: nq[i+v]=min(nq[i+v],q[i]*2+0) if i*v<=T: nq[i*v]=min(nq[i*v],q[i]*2+1) q=nq o="" for i in reversed(range(n-1)): o+="*" if (q[T]>>i)&1 else "+" print(o)