#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()

int n;
string ans = "";

int p[101010];

int q[101010];

int main() {
  cin >> n;
  for(int i = 0;i < n;i++) {
    cin >> p[i];
  }
  for(int i = 0;i < n;i++) {
    q[p[i]] = i + 1;
  }

  vector<int> vec;

  int cnt = 1;

  for(int i = 1;i <= n;i++) {
    vec.push_back(q[i]);
    ans += "(";
    while(!vec.empty() && vec.back() == cnt) {
      ans += ")";
      vec.pop_back();
      cnt++;
    }
  }
  if(ans.size() == 2 * n)
    cout << ans << endl;
  else {
    cout << ":(" << endl;
  }
}

