x[60][100100],a[60],m,i;char p[60];f(i,s){if(!a[i]&&s==m)puts(p+1),exit(0);if(s>m|!a[i]||x[i][s]++)return 0;p[i]=43,f(i+1,s+a[i]);p[i]--,f(i+1,s*a[i]);}main(){for(scanf("%*d%d",&m);~scanf("%d",a+i++););f(1,*a);}