n = int(input()) tot = int(input()) a = list(map(int, input().split())) dp = [None] * (tot + 1) dp[a[0]] = '' for x in a[1:]: ndp = [None] * (tot + 1) for i in range(tot + 1): if dp[i] is not None: if i + x <= tot: t = dp[i] + '+' if ndp[i + x] is None or t < ndp[i + x]: ndp[i + x] = t if i * x <= tot: t = dp[i] + ',' if ndp[i * x] is None or t < ndp[i * x]: ndp[i * x] = t dp = ndp print(dp[tot].replace(',', '*'))