#include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, t; cin >> n >> t; vector a(n); for (int i = 0; i < n; i++) cin >> a.at(i); vector> dp(n, vector(t + 1, "")); dp[0][a[0]] += '!'; for (int i = 0; i < n - 1; i++) { for (int j = 0; j <= t; j++) { if (dp[i][j] == "") continue; if (j + a[i + 1] <= t) { string keep = dp[i][j] + '+'; if (dp[i + 1][j + a[i + 1]] == "") dp[i + 1][j + a[i + 1]] = keep; else if (dp[i + 1][j + a[i + 1]] < keep) dp[i + 1][j + a[i + 1]] = keep; } if (j * a[i + 1] <= t) { string keep = dp[i][j] + '*'; if (dp[i + 1][j * a[i + 1]] == "") dp[i + 1][j * a[i + 1]] = keep; else if (dp[i + 1][j * a[i + 1]] < keep) dp[i + 1][j * a[i + 1]] = keep; } } } string ans = dp[n - 1][t].substr(1); cout << ans << '\n'; }