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

typedef long long ll;
typedef unsigned long long ull;

int main() {
  ll n;
  cin >> n;

  vector<ll> p(n);
  for (ll i = 0; i < n; ++i) {
    cin >> p[i];
    p[i]--;
  }

  bool ok = true;
  ll cur = 0;
  stack<ll> stack;
  stringstream ss;
  for (ll i = 0; i < n; ++i) {
    for (; cur <= p[i]; ++cur) {
      ss << "(";
      stack.push(cur);
    }

    if (stack.top() != p[i]) {
      ok = false;
      break;
    }

    ss << ")";
    stack.pop();
  }

  if (ok) {
    cout << ss.str() << endl;
  } else {
    cout << ":(" << endl;
  }

  return 0;
}
