#include using namespace std; #define ll long long int main(){ cin.tie(nullptr)->sync_with_stdio(false); ll N, T; cin >> N >> T; vector A(N, 0ll); for(auto& x: A) cin >> x; vector dp(N + 1, vector(T + 1, false)); dp[N][T] = true; for(int i = N - 1; i >= 0; --i){ for(int t = 1; t <= T; ++t) if(dp[i + 1][t]){ if(0 <= t - A[i]) dp[i][t - A[i]] = true; if(t % A[i] == 0) dp[i][t / A[i]] = true; } } if(!dp[0][0]) cout << -1; else{ string ans = ""; ll s = A[0]; for(int i = 1; i < N; ++i){ if(s + A[i] <= T && dp[i + 1][s + A[i]]){ ans += '+'; s += A[i]; continue; } if(s * A[i] <= T && dp[i + 1][s * A[i]]){ ans += '*'; s *= A[i]; continue; } assert(false); } assert(s == T); cout << ans; } cout << endl; return 0; }