def rev(lists, times, goal, num, ans=[]): # リスト 何回目 最終的な値 数値 答えの記録 if times == len(lists) and goal == num: ans.append(True) return ans elif times == len(lists): ans.append(False) return ans for i in range(2): if i == 0: tmp = rev(lists, times+1, goal, num+lists[times], ans+['+']) elif i == 1: tmp = rev(lists, times+1, goal, num*lists[times], ans+['*']) if tmp != None: if tmp[-1]: return tmp n = int(input()) total = int(input()) st, *a = list(map(int, input().split())) ans = rev(a, 0, total, st) [print(i, end='') for i in ans[:-1:]] print()