#include <bits/stdc++.h>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

const ll OFF = 2e6;

ll n, a[MAX_N], dp[MAX_N], trace[MAX_N];
char ans[MAX_N];
string s; 

void find(int l, int r) {
    while (l < r && a[l] == 1) ans[++l] = '+';
    while (l < r && a[r - 1] == 1) ans[--r] = '+';
    if (l >= r) return;
    ll prod = 1;
    for (int i = l; i < r; i++) {
        prod *= a[i];
        if (prod > OFF) break;
    }
    if (prod > OFF) {
        for (int i = l + 1; i < r; i++) ans[i] = '*';
        return;
    }
    
    // for (int i = l; i <= r; i++) dp[i] = 0, trace[i] = -1;
    // for (int i = l; i < r; i++) {
    //     if (a[i] == 1) {
    //         dp[i + 1] = dp[i] + 1;
    //         trace[i + 1] = i;
    //         continue;
    //     }
    //     prod = 1;
    //     for (int j = i; j >= l; j--) {
    //         prod *= a[j];
    //         if (prod + dp[j] > dp[i + 1]) {
    //             dp[i + 1] = prod + dp[j];
    //             trace[i + 1] = j;
    //         }
    //     }
    // }

    for (int i = l; i <= r; i++) {
        dp[i] = 0;
        trace[i] = -1;
    }

    for (int i = l; i < r; i++) {
        if (a[i] == 1) {
            dp[i + 1] = dp[i] + 1;
            trace[i + 1] = i;
            continue;
        }

        ll product = 1;

        for (int j = i; j >= l; j--) {
            product *= a[j];

            if (product + dp[j] > dp[i + 1]) {
                dp[i + 1] = product + dp[j];
                trace[i + 1] = j;
            }
        }
    }

    for (int i = r; i > l; i = trace[i]) {
        for (int j = i - 1; j > trace[i]; j--) {
            ans[j] = '*';
        }
        ans[trace[i]] = '+';
    }
}

void solve() {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    cin >> s;
    sort(s.begin(), s.end()); // {*+-}
    if (s == "+-") s = "+";
    if (s.size() == 1) {
        for (int i = 0; i < n; i++) {
            cout << a[i] << (i < n - 1 ? s[0] : '\n');
        }
        return;
    }
    if (s == "*-") {
        cout << a[0];
        for (int i = 1; i < n; i++) {
            cout << (a[i] == 0 ? "-" : "*") << a[i];
        }
        return;
    }
    if (s.size() == 3) s = "*+";

    assert(s == "*+");
    for (int i = 0, j = 0; i < n; i = j) {
        while (j < n && (a[i] > 0) == (a[j] > 0)) j++;
        if (a[i] > 0) find(i, j);
    }
    for (int i = 0; i < n; i++) {
        if (a[i] == 0) ans[i] = ans[i + 1] = '+';
    }
    for (int i = 0; i < n; i++) {
        cout << a[i] << (i < n - 1 ? ans[i + 1] : '\n');
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int tc = 1;
    // cin >> tc;
    for (int t = 1; t <= tc; t++) {
        // cout << "Case #" << t  << ": ";
        solve();
    }
}