// yukicoder: 10 +か×か // 2021.8.13 #include typedef long long ll; #define gc() getchar_unlocked() #define pc(c) putchar_unlocked(c) int in() { // 非負整数の入力 int n = 0, c = gc(); do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0'); return n; } ll dp[55][100005]; // +or* void chmin(ll *a, ll b) { if (*a == 0 || *a > b) *a = b; } int max(int a, int b) { return a >= b? a: b; } int main() { int i, j, ma, A; int N = in(), total = in(); A = in(), dp[0][A] = 1, ma = A; for (i = 1; i < N; ++i) { A = in(); for (j = ma; j >= 0; --j) if (dp[i-1][j]) { int t; t = j*A; if (t <= total) chmin(&dp[i][t], (dp[i-1][j]<<1)|1); t = j+A; if (t <= total) chmin(&dp[i][t], dp[i-1][j]<<1); } ma = max(ma*A, ma+A); if (ma > total) ma = total; } for (i = N-2; i >= 0; --i) pc((dp[N-1][total]>>i) & 1? '*': '+'); pc('\n'); return 0; }