// yukicoder: No.10 +か×か // 2019.7.24 bal4u #include typedef long long ll; #if 1 #define gc() getchar_unlocked() #define pc(c) putchar_unlocked(c) #else #define gc() getchar() #define pc(c) putchar(c) #endif int in() { // 非負整数の入力 int n = 0, c = gc(); do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0'); return n; } typedef struct { char i; int s; ll b; } Q; Q q[10000003]; int top, end; int total; int a[53], N; char vis[100003][53]; int main() { int i, s, t; ll b; N = in()-1, total = in(), s = 0; for (i = 0; i <= N; i++) a[i] = in(), s += a[i]; if (s == total) { while (N--) pc('+'); pc('\n'); return 0; } q[0].i = 1, q[0].s = a[0], end = 1; while (top != end) { i = q[top].i, s = q[top].s, b = q[top++].b; if ((t = s + a[i]) <= total && !vis[t][i]) { vis[t][i] = 1; if (i == N) { if (t == total) break; } else q[end].i = i+1, q[end].s = t, q[end++].b = b; } if ((t = s * a[i]) > total || vis[t][i]) continue; vis[t][i] = 1, b |= (1LL << i); if (i == N) { if (t == total) break; } else q[end].i = i+1, q[end].s = t, q[end++].b = b; } while (N--) b >>= 1, pc(b & 1? '*': '+'); pc('\n'); return 0; }