#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const ll inf = 1e16;
int n, m, a[N], pre[N];
ll dp[N];
bool add[N];
int q[N], h, t;
char s[5];
map<char, int> num;
void apt(int l, int r, char x)
{
    for (int i = l; i <= r; ++i)
    {
        printf("%d", a[i]);
        if (i != r)
            putchar(x);
    }
}
bool upd(ll &x, ll y)
{
    if (x < y)
    {
        x = y;
        return 1;
    }
    return 0;
}
void solve(int l, int r)
{
	int nl = l, nr = r; 
    //注意0的存在 使段乘积>=inf 而总乘积=0
    bool ok = false;
    ll all = 1;
    for (int i = l; i <= r; ++i)
    {
        all *= a[i];
        if (all >= inf)
        {
            ok = true;
            break;
        }
    }
    if (ok)
    {
		//注意两边1的存在 不能出现在连积的case里 所以事先特判 
		while (l <= r && a[l] == 1)
		{
			add[l++] = 1;
		} 
		while (l <= r && a[r] == 1)
		{
			add[--r] = 1;
		}
    }
    else
	{
    	h = 1;
	    t = 0;
	    for (int i = l; i <= r; ++i)
	        if (a[i] >= 2)
	            q[++t] = i;
	    dp[l - 1] = 0;
	    for (int i = l; i <= r; ++i)
	    {
	        if (upd(dp[i], dp[i - 1] + a[i]))
	        {
	            pre[i] = i - 1;
	        }
	        while (h <= t && q[h] < i)
	        {
	            h++;
	        }
	        ll now = 1;
	        //a[i-1] + a[i]*...*a[p] +
	        for (int j = h; j <= t; ++j)
	        {
	            int p = q[j];
	            now *= a[p];
	            if (upd(dp[p], dp[i - 1] + now))
	            {
	                pre[p] = i - 1;
	            }
	        }
	    }
	    for (int i = r; i != l - 1; i = pre[i])
	    {
	        add[i] = 1;
	    }
    }
    for (int i = nl; i <= nr; ++i)
    {
        printf("%d", a[i]);
        if (i != nr)
        {
            putchar(add[i] ? '+' : '*');
        }
    }
}
int main()
{
    memset(dp, -1, sizeof dp);
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i)
    {
        scanf("%d", &a[i]);
    }
    scanf("%s", s);
    m = strlen(s);
    for (int i = 0; i < m; ++i)
    {
        num[s[i]]++;
    }
    //+ - *
    if (m == 1)
    {
        apt(1, n, s[0]);
        return 0;
    }
    //+-
    if (m == 2 && !num['*'])
    {
        apt(1, n, '+');
        return 0;
    }
    //*-
    if (m == 2 && !num['+'])
    {
        for (int i = 1; i <= n; ++i)
        {
            printf("%d", a[i]);
            if (i != n)
            {
                putchar(a[i + 1] == 0 ? '-' : '*');
            }
        }
        return 0;
    }
    //+* +*-
    for (int i = 1, j; i <= n; i = j + 1)
    {
        j = i;
        if (a[i])
        {
            while (j + 1 <= n && a[j + 1])
                j++;
        }
        solve(i, j);
        if (j != n)
            putchar('+');
    }
    return 0;
}