N = int(input()) total = int(input()) A = list(map(int,input().split())) stack = [(N-1,total,"")] while stack: i,v,s = stack.pop() if i == 0: if v == A[i]: print(s) break continue if v % A[i] == 0: stack.append((i-1,v//A[i],s+"*")) if A[i] <= v: stack.append((i-1,v-A[i],s+"+"))