#include #define int long long #define uint unsigned int #define REP(i, n) for (int i = 0; i < (n); ++i) #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 ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define SZ(a) ((int)(a).size()) #define PB(a) push_back(a) #define EB(...) emplace_back(__VA_ARGS__) #define MP(a, b) make_pair(a, b) #define MT(...) make_tuple(__VA_ARGS__) #define Bit(n) (1LL << (n)) using namespace std; using pii = pair; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } const int MOD = 1000000007; const int INF = 1LL << 30; const double EPS = 1e-10; int N, T; int A[51]; int dp[51][100010]; string ans; int dfs(int p, int s) { if (s > T) return -1; if (dp[p][s]) return dp[p][s]; if (p == N) return s == T ? 1 : -1; if (dfs(p+1, s+A[p]) > 0) ans = "+" + ans; else if (dfs(p+1, s*A[p]) > 0) ans = "*" + ans; else return dp[p][s] = -1; return dp[p][s] = 1; } signed main() { cin.tie(0); ios_base::sync_with_stdio(false); cout << fixed << setprecision(10); cin >> N >> T; REP(i, N) cin >> A[i]; dfs(0, 0); cout << ans.substr(1) << endl; return 0; }