#include <cstdio>
#include <cstring>
#include <cassert>

#define maxn 200000
#define maxa (int)1e9
#define maxk 40

int n, a[maxn], s[maxn];
int k, space[maxk], num[maxk], st1[maxk], st2[maxk];
int f[maxk], pr[maxk];

void Set( int i, int x )
{
  if (0 <= i && i < n)
    s[i] = x;
}

void Set( int l, int r, int x )
{
  for (int i = l; i <= r; i++)
    Set(i, x);
}

void Solve( int l, int r )
{
  int i, j, p;

  while (l <= r && a[l] == 1)
    Set(l++, 1);
  while (l <= r && a[r] == 1)
    Set(--r, 1);

  p = 1;
  for (i = l; i <= r; i++)
    if (a[i] > (int)1e9 / p)
    {
      Set(l, r - 1, 2);
      return;
    }
    else
      p *= a[i];

  k = 0;
  for (i = l; i <= r; i = j)
  {
    st1[k] = i;
    num[k] = 1;
    for (j = i; j <= r && a[j] > 1; j++)
      num[k] *= a[j];

    st2[k] = j;
    space[k] = 0;
    while (j <= r && a[j] == 1)
      space[k]++, j++;

    k++;
  }

  memset(f, 0, sizeof(f));
  for (i = 0; i < k; i++)
    for (p = 1, j = i; j < k; j++)
    {
      int tmp;
      p *= num[j];
      if (f[j + 1] < (tmp = f[i] + p + space[j]))
        f[j + 1] = tmp, pr[j + 1] = i;
    }
  for (i = k; i > 0; i = pr[i])
    Set(st1[pr[i]], st2[i - 1] - 2, 2);
}

int main()
{
  int i, j;

  freopen("expr.in", "r", stdin);
  freopen("expr.out", "w", stdout);

  scanf("%d", &n);
  assert(getc(stdin) == '\n');
  assert(2 <= n && n <= maxn);
  for (i = 0; i < n; i++)
  {
    scanf("%d", &a[i]);
    assert(0 <= a[i] && a[i] <= maxa);
  }
  assert(getc(stdin) == '\n');

  memset(s, 0, sizeof(s));
  Set(0, n - 1, 1);
  i = 0;
  while (i < n)
    if (a[i])
    {
      for (j = i; j < n && a[j]; j++)
        ;
      Solve(i, j - 1);
      i = j;
    }
    else
      i++;

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