#include <bits/stdc++.h>

#define int long long

using namespace std;

#ifdef LOCAL 
#include "/media/brayand/BrayanD/debugger.h"
#else
#define db(...) false
#define dbl(...) false
#define dbg(...) false
#endif

string f(vector<int> vect)
{
	string res;

	int N = vect.size();

	int num = 1;

	for(auto x : vect)
	{
		num *= x;

		if(num/2 > N)
		{

			int one1 = 0, one2 = 0;

			for(int i = 0 ; i < N ; i++)
			{
				if(vect[i] == 1)one1++;
				else break;
			}

			for(int i = N-1 ; i >= 0 ; i--)
			{
				if(vect[i] == 1)one2++;
				else break;
			}

			for(int i = 0 ; i < one1 ; i++)
			{
				res += "1+";
			}

			for(int i = one1 ; i < N-one2 ; i++)
			{
				res += to_string(vect[i]);
				if(i+1 < N-one2)res += "*";
			}

			for(int i = 0 ; i < one2 ; i++)
			{
				res += "+1";
			}

			return res;
		}
	}

	if(num == 1)
	{
		for(int i = 0 ; i < N ; i++)
		{
			res += to_string(vect[i]);
			if(i+1 < N)res += "+";
		}
		return res;
	}

	int cont = 0;
	num = 1;

	vector<int> vvv;
	vector<int> one;

	vector<vector<int>> kkk;

	vector<int> ttt;

	for(int i = 0 ; i < N ; i++)
	{
		if(vect[i] != 1)
		{
			num *= vect[i];
			ttt.push_back(vect[i]);
			if(vvv.size())
			{
				if(cont)one.push_back(cont);
			}
			cont = 0;
		}
		else
		{
			if(num > 1)
			{
				vvv.push_back(num);
				kkk.push_back(ttt);
			}
			ttt.clear();
			num = 1;
			cont++;
		}
	}

	if(num > 1)
	{
		vvv.push_back(num);
		kkk.push_back(ttt);
	}
	num = 1;

	if(one.size() == vvv.size())
	{
		one.pop_back();
	}

	int sz = one.size();

	if(sz == 0)
	{
		for(int i = 0 ; i < N ; i++)
		{
			res += to_string(vect[i]);
			if(i+1 < N)
			{
				if(vect[i] == 1 || vect[i+1] == 1)res += "+";
				else res += "*";
			}
		}
		return res;
	}

	int best = -1e18;
	int bmask = -1e18;

	for(int mask = 0 ; mask < (1<<sz) ; mask++)
	{
		int sum = 0;
		int num = vvv[0];
		for(int i = 0 ; i < sz ; i++)
		{
			if(mask&(1<<i))
			{
				num *= vvv[i+1];
			}
			else
			{
				sum += num;
				sum += one[i];
				num = vvv[i+1];
			}
		}
		sum += num;

		if(sum > best)
		{
			best = sum;
			bmask = mask;
		}
	}

	int one1 = 0, one2 = 0;

	for(int i = 0 ; i < N ; i++)
	{
		if(vect[i] == 1)one1++;
		else break;
	}

	for(int i = N-1 ; i >= 0 ; i--)
	{
		if(vect[i] == 1)one2++;
		else break;
	}

	for(int i = 0 ; i < one1 ; i++)
	{
		res += "1+";	
	}

	for(int i = 0 ; i < kkk[0].size() ; i++)
	{
		res += to_string(kkk[0][i]);
		if(i+1 < kkk[0].size())res += "*";
	}

	for(int i = 0 ; i < sz ; i++)
	{
		if(bmask&(1<<i))
		{
			for(int x = 0 ; x < one[i] ; x++)
			{
				res += "*1";
			}
			res += "*";
		}
		else
		{
			for(int x = 0 ; x < one[i] ; x++)
			{
				res += "+1";
			}	
			res += "+";
		}
		for(int x = 0 ; x < kkk[i+1].size() ; x++)
		{
			res += to_string(kkk[i+1][x]);
			if(x+1 < kkk[i+1].size())res += "*";
		}
	}

	for(int i = 0 ; i < one2 ; i++)
	{
		res += "+1";
	}

	return res;
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int N;
    cin >> N;

    vector<int> vect;

    for(int i = 0 ; i < N ; i++)
    {
    	int n;
    	cin >> n;
    	vect.push_back(n);
    }

    string cad;
    cin >> cad;

    sort(cad.begin(), cad.end());

    if(cad == "*")
    {
    	for(int i = 0 ; i < N ; i++)
    	{
    		cout << vect[i];
    		if(i+1 < N)cout << "*";
    	}
    	cout << '\n';
    	return 0;
    }

    if(cad == "+")
    {
    	for(int i = 0 ; i < N ; i++)
    	{
    		cout << vect[i];
    		if(i+1 < N)cout << "+";
    	}
    	cout << '\n';
    	return 0;
    }

    if(cad == "-")
    {
    	for(int i = 0 ; i < N ; i++)
    	{
    		cout << vect[i];
    		if(i+1 < N)cout << "-";
    	}
    	cout << '\n';
    	return 0;
    }

    if(cad == "+-")
    {
    	for(int i = 0 ; i < N ; i++)
    	{
    		cout << vect[i];
    		if(i+1 < N)cout << "+";
    	}
    	cout << '\n';
    	return 0;
    }

    if(cad == "*-")
    {
    	int last = -1;
    	for(int i = 0 ; i < N ; i++)
    	{
    		if(vect[i] == 0)
    		{
    			last = i;
    			break;
    		}
    	}

    	if(last == -1)
    	{
    		for(int i = 0 ; i < N ; i++)
	    	{
	    		cout << vect[i];
	    		if(i+1 < N)cout << "*";
	    	}
	    	cout << '\n';
	    	return 0;
    	}

    	for(int i = 0 ; i < N ; i++)
    	{
    		cout << vect[i];
    		if(i+1 < N)
			{
				if(i+1 == last)cout << "-";
				else cout << "*";
			}
    	}
    	cout << '\n';
    	return 0;
    }

    vector<int> temp;

    vector<string> vvv;

    for(int i = 0 ; i < N ; i++)
    {
    	if(vect[i])
    	{
    		temp.push_back(vect[i]);
    	}
    	else
    	{
    		if(temp.size())
    		{
    			vvv.push_back(f(temp));
    		}
    		temp.clear();

    		vvv.push_back("0");
    	}
    }

    if(temp.size())
	{
		vvv.push_back(f(temp));
	}
	temp.clear();

    string res;

    for(int i = 0 ; i < vvv.size() ; i++)
    {
    	res += vvv[i];
    	if(i+1 < vvv.size())res += "+";
    }

    cout << res << '\n';

    return 0;
}
