#include using namespace std; int memo[51][100010]; int main() { int N, Total, A[60]; cin >> N >> Total; for (int i = 0; i < N; i++) cin >> A[i]; memo[0][A[0]] = 1; for (int i = 1; i < N; i++) { for (int x = 0; x <= Total; x++) { if (memo[i - 1][x]) { if (A[i] + x <= Total) { memo[i][x + A[i]] = 1; } if (A[i] * x <= Total && !memo[i][x * A[i]]) { memo[i][x * A[i]] = 2; } } } } string ans; int tot = Total; for (int i = N - 1; i > 0; i--) { if (memo[i][tot] == 1) { ans.push_back('+'); tot -= A[i]; } else { ans.push_back('*'); tot /= A[i]; } } reverse(ans.end(), ans.begin()); cout << ans << endl; }