#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define int long long
using namespace std;
typedef pair<int,int>P;
typedef pair<P,int>P2;
#define fi first
#define se second
 
 
void END(){
  cout<<":("<<endl;
  exit(0);
}
 
signed main(){
  int n;
  cin>>n;
  int a[n];
  vector<P>ve;
  r(i,n){
    cin>>a[i];
    ve.push_back(P(a[i],i+1));
  }
 
  sort(ve.begin(),ve.end());
 
  r(i,n){
    a[i]=ve[i].second;
  }
 
  stack<P>st1;
  stack<P>st2;
 
  int del=1;
 
  string s;
 
  r(i,n){
 
    s+="(";
 
    ///st1.push(P(a[i],i+1));
    st2.push(P(a[i],i+1));
 
    while(!st2.empty()){
      if(st2.top().first!=del)break;
      s+=")";
      st2.pop();
      del++;
    }
 
    //cout<<st1.size()<<' '<<st2.size()<<endl;
  }
 
  if(!st1.empty()) END();
  if(!st2.empty()) END();
 
  cout<<s<<endl;
 
}
