#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef _MSC_VER #include #endif #define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i) #define rep(i, n) FOR(i, 0, n) #define ALL(v) v.begin(), v.end() #define REV(v) v.rbegin(), v.rend() #define MEMSET(v, s) memset(v, s, sizeof(v)) #define UNIQUE(v) (v).erase(unique(ALL(v)), (v).end()) #define MP make_pair #define MT make_tuple using namespace std; typedef long long ll; typedef pair P; const int N = 1e5 + 10; int dp[55][N]; string history[55][N]; int a[55]; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n, total; cin >> n >> total; rep(i, n) cin >> a[i]; rep(i, 55) rep(j, N) history[i][j] = string(1, '3'); dp[1][a[0]] = 1; history[1][a[0]] = ""; FOR(i, 1, n){ rep(j, total+1){ if (!dp[i][j]) continue; if (j * a[i] <= total){ dp[i + 1][j * a[i]] = 1; history[i + 1][j*a[i]] = min(history[i + 1][j*a[i]], history[i][j] + '2'); } } rep(j, total+1){ if (!dp[i][j]) continue; if (j + a[i] <= total){ dp[i + 1][j + a[i]] = 1; history[i + 1][j+a[i]] = min(history[i + 1][j+a[i]], history[i][j] + '1'); } } } char c[256] = {}; c['1'] = '+', c['2'] = '*'; for (auto ch : history[n][total]){ cout << c[ch]; } cout << endl; return 0; }