#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;

}


/*
typedef unsigned long long ull;


struct RollingHash{
  typedef unsigned long long ull;
  string S;
  ull B;
  int len;
  vector<ull> hash,p;
  RollingHash(){}
  RollingHash(string S_,ull B_=1000000007LL):
    S(S_),B(B_),len(S.length()),hash(len+1),p(len+1){
    hash[0]=0;p[0]=1;
    for(int i=0;i<len;i++){
      hash[i+1]=hash[i]*B+S[i];
      p[i+1]=p[i]*B;
    }
  }
  //S[l,r)
  ull find(int l,int r){
    return hash[r]-hash[l]*p[r-l];
  }
};

signed main(){
  int n;
  cin>>n;
  string s;
  cin>>s;
  string t=s;

  RollingHash S(s);
  RollingHash T(t);

  for(int i=1;i<n;i++){

    int idx=0 , F=0 ;
    ull A=S.find(0,i);

    for(int j=0;;j++){
      if(j%2==0){
        if(S.find(idx+i) != A){
          F++;
          break;
        }
      }
      else{

      }

      idx+=i-1;
    }

    if(!F){

    }
  }

}

*/
