# import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') from collections import * from functools import * from itertools import * from heapq import * import sys,math input = sys.stdin.readline N = int(input()) T = int(input()) A = list(map(int,input().split())) val = [False]*(100005) X = defaultdict(lambda:'') M = 10**5+5 val[A[0]]=True for i in range(N-1): called = [False]*(10**5+5) a = A[i+1] for j in range(M-1-a,-1,-1): if val[j]: val[j+a]=True called[j+a]=True X[j+a] = X[j]+'+' for j in range(M-1,-1,-1): if called[j]: continue if j*a>=M: continue val[j*a]=True X[j*a] = X[j]+'*' print(X[T])