#include using namespace std; int main() { int n, total; cin >> n >> total; vector a(n); for (int& i : a) cin >> i; vector> dp(n, vector(total + 1, -1)); dp[0][a[0]] = 0; for (int i = 1; i < n; ++i) { for (int j = 0; j <= total; ++j) { if (dp[i - 1][j] == -1) continue; if (j + a[i] <= total) dp[i][j + a[i]] = 0; if (j * a[i] <= total && dp[i][j * a[i]] == -1) dp[i][j * a[i]] = 1; } } string res; for (int i = n - 1; i >= 1; --i) { if (dp[i][total] == 0) { res = "+" + res; total -= a[i]; } else { res = "*" + res; total /= a[i]; } } cout << res << endl; }