import bisect import copy import decimal import fractions import heapq import itertools import math import random import sys from collections import Counter, deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap, 0, len(heap)-1) def _heappushpop_max(heap, item): if heap and item < heap[0]: item, heap[0] = heap[0], item heapq._siftup_max(heap, 0) return item from math import gcd as GCD read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines N=int(readline()) total=int(readline()) A=list(map(int,readline().split())) dp=[[False]*(total+1) for i in range(N)] dp[N-1][total]=True for i in range(N-2,-1,-1): a=A[i+1] for t in range(total+1): if dp[i+1][t]: if 0<=t-a: dp[i][t-a]=True if t%a==0: dp[i][t//a]=True ans_lst=[] s=A[0] for i in range(1,N): a=A[i] if s+a<=total and dp[i][s+a]: s+=a ans_lst.append('+') else: s*=a ans_lst.append('*') print(*ans_lst,sep='')