#include #define all(x) begin(x),end(x) #define rall(x) (x).rbegin(),(x).rend() #define REP(i,b,n) for(int i=(int)(b);i<(int)(n);++i) #define rep(i,n) REP(i,0,n) #define repsz(i,v) rep(i,(v).size()) #define aur auto& #define bit(n) (1LL<<(n)) #define eb emplace_back #define mt make_tuple #define fst first #define snd second using namespace std; typedef long long ll; //#define int long long templateint size(const C &c){ return c.size(); } templatebool chmin(T&a,const T&b){if(a<=b)return false;a=b;return true;} templatebool chmax(T&a,const T&b){if(a>=b)return false;a=b;return true;} template std::vector get_vec(size_t n){//{{{ std::vector res; res.reserve(n); for(size_t i = 0; i < n; ++i){ T x; std::cin >> x; res.emplace_back(x); } return res; }//}}} template std::vector get_vec(size_t n, const T &x){//{{{ std::vector res; res.reserve(n); for(size_t i = 0; i < n; ++i){ T x; std::cin >> x; res.emplace_back(x); } return res; }//}}} bool solve(){ int n; cin >> n; int total; cin >> total; auto as = get_vec(n, 0); vector dp(total+1, " "); dp[as[0]] = ""; rep(i, n) if(i){ vector qb(total+1, " "); rep(t, total+1){ if(t+as[i] <= total) chmax(qb[t+as[i]], dp[t] + "+"); if(t*as[i] <= total) chmax(qb[t*as[i]], dp[t] + "*"); } swap(dp, qb); } cout << dp[total] << endl; return true; } signed main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << std::fixed << std::setprecision(10); solve(); return 0; } // vim:set foldmethod=marker commentstring=//%s: