#include #include using namespace std; int main(){ int64_t n, total; cin >> n >> total; int64_t a[n], inf = 1ll << n; for(int i = 0; i < n; i++) cin >> a[i]; int64_t dp[n][total + 1]; fill(dp[0], dp[n], inf); dp[0][a[0]] = 0; for(int i = 1; i < n; i++) for(int j = 0; j <= total; j++) if(dp[i - 1][j] != inf){ if(j + a[i] <= total) dp[i][j + a[i]] = min(dp[i][j + a[i]], 2 * dp[i - 1][j]); if(j * a[i] <= total) dp[i][j * a[i]] = min(dp[i][j * a[i]], 2 * dp[i - 1][j] + 1); } for(int i = n - 2; 0 <= i; i--) cout << ((dp[n - 1][total] >> i) % 2 == 0 ? '+' : '*'); cout << endl; }