#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define BET(a,b,c) ((a)<=(b)&&(b)<(c)) #define FOR(i,n) for(int i=0,i##_end=(int(n));i VI; typedef vector VVI; string result = ""; int N,total; int memo[51][100000+1]; int dfs(const VI& A, int pos, int x){ if(x > total) return 0; if(pos == N){ return x == total; } int& ret = memo[pos][x]; if(ret != -1) return ret; if(dfs(A, pos+1, x + A[pos])){ result += "+"; return 1; } if(dfs(A, pos+1, x * A[pos])){ result += "*"; return 1; } return ret = 0 ; } int main() { cin>>N>>total; VI A(N); FOR(i,N) cin>>A[i]; memset(memo , -1 , sizeof(memo)); dfs(A, 1, A[0]); reverse(ALL(result)); cout<