#include <bits/stdc++.h>

using namespace std;

#define DEB if(0)
typedef long long LL;
typedef pair<int, int> pii;

const int N = 100010;
int n;
int a[N];
LL mul[N];

char s[10];
const LL INF = 1e17;
LL f[100];
int plan[100];

vector<pii> parts;

void retrieve_plan(int cur) {
    if (cur < 0) return;
    int pre = plan[cur] - 1;
    if (pre >= 0) {
        retrieve_plan(pre);
        for (int i = parts[pre].second + 1; i < parts[pre + 1].first; ++i)
            printf("+%d", a[i]);
        putchar('+');
    }
    for (int i = parts[pre + 1].first; i <= parts[cur].second; ++i) {
        printf("%d", a[i]);
        if (i < parts[cur].second) putchar('*');
    }
}

void solve(int start, int end) {
    // prefix 1
    for (; start <= end && a[start] == 1; start++) {
        putchar('1');
        if (start < end) putchar('+');
    }
    if (start > end) return;
    int real_end;
    for (real_end = end; real_end > start && a[real_end] == 1; real_end--);
    swap(real_end, end);

    mul[start - 1] = 1;
    parts.clear();
    int last = 0;
    for (int i = start; i <= end; ++i) {
        if (mul[i - 1] <= INF) mul[i] = mul[i - 1] * a[i];
        else mul[i] = mul[i - 1];
        if (a[i] == 1) {
            if (last) {
                parts.emplace_back(last, i - 1);
                last = 0;
            }
        } else if (!last) last = i;
    }
    if (last) parts.emplace_back(last, end);
    if (mul[end] >= INF) {
        // all *
        for (int i = start; i <= end; ++i) {
            printf("%d", a[i]);
            if (i < end) putchar('*');
        }
    } else {
        // dp
        int tot = parts.size();
        for (int i = 0; i < tot; ++i) {
            f[i] = mul[parts[i].second] / mul[parts[0].first - 1];
            plan[i] = 0;
            for (int j = 1; j <= i; ++j) {
                LL one = f[j - 1];
                LL two = parts[j].first - parts[j - 1].second - 1;
                LL three = mul[parts[i].second] / mul[parts[j].first - 1];
                LL res = one + two + three;
                if (res > f[i]) {
                    f[i] = res;
                    plan[i] = j;
                }
            }
        }
        retrieve_plan(parts.size() - 1);
    }

    // suffix 1
    if (end < real_end) {
        for (int i = end + 1; i <= real_end; ++i) printf("+1");
    }
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) scanf("%d", a + i);
    scanf("%s", s);
    int op_len = strlen(s);
    sort(s, s + op_len);

    // * + - +-
    if (op_len == 1 || strcmp(s, "+-") == 0) {
        for (int i = 1; i <= n; ++i)
            printf("%d%c", a[i], (i == n ? '\n' : s[0]));
        return 0;
    }

    // *-
    if (strcmp(s, "*-") == 0) {
        bool has_zero = false;
        for (int i = 1; i < n; ++i) {
            printf("%d", a[i]);
            if (has_zero) {
                putchar('*');
                continue;
            }
            if (!a[i + 1]) {
                has_zero = true;
                putchar('-');
                continue;
            }
            putchar('*');
        }
        printf("%d\n", a[n]);
        return 0;
    }

    // *+ *+-
    int start = 0;
    for (int i = 1; i <= n; ++i) {
        if (a[i]) {
            if (!start) start = i;
            continue;
        }
        if (start) {
            solve(start, i - 1);
            start = 0;
            putchar('+');
        }
        putchar('0');
        if (i < n) putchar('+');
    }
    if (start) solve(start, n);

    return 0;
}
