#include #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define FORR(i,a,b) for (int i=(a);i>=(b);i--) #define pb push_back using namespace std; typedef long long ll; typedef pair pii; typedef vector vi; typedef set si; const int inf = 1e9; const int mod = 1e9+7; map mn, mt; int n, t; main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> n >> t; int w; cin >> w; mt[w] = 0; FOR(i, 0, n-1){ int w; cin >> w; for(map::iterator itr = mt.begin(); itr != mt.end(); itr++){ int a = itr->first; ll b = itr->second; int li[2]; li[0]= a + w; li[1]= a * w; FOR(j, 0, 2){ if(li[j] > t)continue; if(mn.find(li[j]) != mn.end()){ mn[li[j]] = min(mn[li[j]], b * 2 + j); }else{ mn[li[j]] = b * 2 + j; } } } mt.clear(); swap(mt, mn); } ll an = mt[t]; FORR(i, n-2, 0){ cout << (an >> i & 1 ? "*" : "+"); } cout << endl; }