// 2020.12.13
// Code by LTb
// #pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define debug puts("QwQ");
inline int read(){
    int x=0,f=1;
    char ch;
    while(ch<'0'||ch>'9') {if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') {x=x*10+ch-'0';ch=getchar();}
    return f*x;
}

inline char readch(){
	char ch=getchar();
	while (ch==' '||ch=='\n') ch=getchar();
	return ch;
}

inline string readstr(){
	char ch=getchar();
	string ans="";
	while (ch==' '||ch=='\n') ch=getchar();
	while (ch!=' '&&ch!='\n') {ans+=ch;ch=getchar();}
	return ans;
}
inline void chmax(int &x,int y){x=max(x,y);}
inline void chmin(int &x,int y){x=min(x,y);}

const int MAXN=100005;
int n;
int a[MAXN];
bool Plus,Minus,Multiple;
int dp[MAXN],bel[MAXN];
char ans[MAXN];
int nex[MAXN];
int P=1e7;

void sol1(){
	for (int i=2;i<=n;i++)
		if (Plus) ans[i]='+';
		else ans[i]='-';
}

void sol2(){
	for (int i=2;i<=n;i++)
		ans[i]='*';
}

void sol3(){
	int pos=0;
	for (int i=1;i<=n;i++)
		if (!pos && a[i]==0) pos=i;

	for (int i=2;i<=n;i++){
		if (i==pos) ans[i]='-';
		else ans[i]='*';
	}
}

void init(){
	int cur=0;
	for (int i=n;i>=1;i--){
		nex[i]=cur;
		if (a[i]!=1) cur=i;
	}
}

void foo(int l,int r){
	int cnt=1;
	dp[l-1]=0;
	for (int i=l;i<=r;i++){
		if (cnt<P) cnt*=a[i];
		dp[i]=bel[i]=0;
		// cout<<i<<' '<<nex[i]<<endl;
	}

	if (cnt>=P){
		for (int i=l+1;i<=r;i++)
			ans[i]='*';
		return ;
	}

	for (int i=l;i<=r;i++){
		cnt=1;
		for (int j=i;j<=r && j;j=nex[j]){
			cnt*=a[j];
			if (dp[i-1]+cnt>dp[j]){
				dp[j]=dp[i-1]+cnt;
				bel[j]=i-1;
			}
		}
		// cout<<dp[i]<<' ';
	}

	int cur=r;
	while (cur>=l){
		int tmp=bel[cur];
		ans[tmp+1]='+';
		for (int i=tmp+2;i<=cur;i++)
			ans[i]='*';

		cur=tmp;
	}
}

void sol4(){
	init();
	for (int i=1;i<=n;i++){
		if (a[i]==0){
			ans[i+1]=ans[i]='+';
			continue;
		}

		int cur=i;
		while (cur<n && a[cur+1]!=0) cur++;

		int l=i,r=cur;
		while (l<=r && a[l]==1) ans[++l]='+';
		while (l<=r && a[r]==1) ans[r--]='+';
		if (l<=r) foo(l,r);
		i=cur;
	}
}

void print(){
	cout<<a[1];
	for (int i=2;i<=n;i++)
		cout<<ans[i]<<a[i];
	cout<<endl;
}

signed main()

{
	n=read();
	for (int i=1;i<=n;i++)
		a[i]=read();

	string allowed=readstr();
	for (auto i:allowed){
		if (i=='+') Plus=true;
		else if (i=='-') Minus=true;
		else Multiple=true;
	}

	if (!Multiple) sol1();
	else{
		if (!Plus && !Minus) sol2();
		else if (!Plus) sol3();
		else sol4();
	}

	print();
	return 0;
}