#include <bits/stdc++.h>
using namespace std;

using pii = pair<int, int>;
using ll = long long;

#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define sz(v) (int)(v).size()
#define mk make_pair
#define F first
#define S second
#define debug(a) cout << #a << " = " << a << endl;
//#define int long long

const int INF = 1000000009;
const ll MOD = 1000000007LL;

int n;
int a[100009];
char ans[100009];

signed main() { IOS
	cin >> n;
	for (int i = 1; i <= n; ++ i) cin >> a[i];
	string s; cin >> s;	
	
	if (s == "+-" || s == "-+") s = "+";
	if (sz(s) == 1) {
		for (int i = 1; i <= n - 1; ++ i) ans[i] = s[0];
	}
	else if (s == "*-" || s == "-*") {
		for (int i = 1; i <= n - 1; ++ i) ans[i] = '*';
		for (int i = 1; i <= n; ++ i) {
			if (a[i] == 0) {
				ans[i - 1] = '-';
				break;
			}
		}
	}
	else s = "InuiTokoKawaii";
	
	vector<int> dp(n + 1), dp_prev(n + 1);
	auto Solve = [&](int l, int r) -> void {
		while (a[l] == 1) l ++;
		while (a[r] == 1) r --;
		if (r <= l) return;
		
		int res = 1;
		for (int i = l; i <= r; ++ i) {
			res *= a[i];
			if (res >= 2 * (r - l + 1)) {
				for (int j = l; j <= r - 1; ++ j) ans[j] = '*';
				return;
			}
		}
		
		for (int i = l; i <= r; ++ i) {
			dp[i] = 0;
			dp_prev[i] = -1;
		}
		
		dp[l - 1] = 0;
		for (int i = l; i <= r; ++ i) {
			if (a[i] == 1) {
				dp[i] = dp[i - 1] + a[i];
				dp_prev[i] = i - 1;
				continue;
			}
			
			int res = a[i];
			for (int j = i - 1; j >= l - 1; -- j) {
				if (dp[i] <= dp[j] + res) {
					dp[i] = dp[j] + res;
					dp_prev[i] = j;
				}
				res *= a[j];
			}
		}
		
		for (int i = r; i >= l; i = dp_prev[i]) {
			for (int j = dp_prev[i] + 1; j < i; ++ j)
				ans[j] = '*';
		}
	};
	
	if (s == "InuiTokoKawaii") {
		for (int i = 1; i <= n - 1; ++ i) ans[i] = '+';
		for (int i = 1, j = 1; i <= n; i = j) {
			if (j <= n && a[j] == 0) {
				++ j;
				continue;
			}
			while (j <= n && a[j] != 0) ++ j;
			Solve(i, j - 1);
		}
	}
	
	for (int i = 1; i <= n; ++ i) {
		cout << a[i];
		if (i != n) cout << ans[i];
	}
}