#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[N - 1][Total] = 1; for (int i = N - 2; i >= 0; i--) { for (int x = 0; x <= Total; x++) { if (memo[i + 1][x]) { if (x - A[i + 1] >= 0) memo[i][x - A[i + 1]] = 1; if (x % A[i + 1] == 0 && !memo[i][x / A[i + 1]]) { memo[i][x / A[i + 1]] = 2; } } } } string ans; int tot = A[0]; for (int i = 0; i < N - 1; i++) { if (memo[i][tot] == 1) { ans.push_back('+'); tot += A[i + 1]; } else if (memo[i][tot] == 2) { ans.push_back('*'); tot *= A[i + 1]; } else { cerr << "error" << endl; } } cout << ans << endl; }