#include using namespace std; typedef long long ll; typedef vector vint; typedef pair pint; typedef vector vpint; #define rep(i,n) for(int i=0;i<(n);i++) #define reps(i,f,n) for(int i=(f);i<(n);i++) #define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++) #define all(v) (v).begin(),(v).end() #define pb push_back #define mp make_pair #define fi first #define se second #define chmax(a, b) a = (((a)<(b)) ? (b) : (a)) #define chmin(a, b) a = (((a)>(b)) ? (b) : (a)) const int MOD = 1e9 + 7; const int INF = 1e9; //dp[i][j] := i 番目まで見て、+の数が j 個 bool dp[55][100010]; int n, total, a[55]; vector ans; void dfs(int d, int now, string s){ // printf("%d %d\n", d, now); if(d == 0){ if(dp[d][now - a[d + 1]] && now - a[d + 1] >= 0){ ans.pb('+' + s); } if(dp[d][now / a[d + 1]] && now / a[d + 1] >= 0){ ans.pb('*' + s); } return; } if(dp[d][now - a[d + 1]] && now - a[d + 1] >= 0){ dfs(d - 1, now - a[d + 1], '+' + s); } if(dp[d][now / a[d + 1]] && now / a[d + 1] >= 0){ dfs(d - 1, now / a[d + 1], '*' + s); } return; } int main(void){ cin >> n >> total; rep(i, n) cin >> a[i]; rep(i, 55)rep(j, 100010)dp[i][j] = false; dp[0][a[0]] = true; for (int i = 0; i < n - 1; ++i){ for (int j = 0; j <= 100000; ++j){ if(dp[i][j]){ if(j + a[i + 1] <= 100000){ dp[i + 1][j + a[i + 1]] = true; // printf("1 %d %d\n", i + 1, j + a[i + 1]); } if(j * a[i + 1] <= 100000){ dp[i + 1][j * a[i + 1]] = true; // printf("2 %d %d\n", i + 1, j * a[i + 1]); } } } } dfs(n - 2, total, ""); sort(all(ans)); cout << ans[ans.size() - 1] << endl; return 0; }