#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  int n;
  cin>>n;
  vector<int> p(n);
  for(int i=0;i<n;i++) cin>>p[i],p[i]--;
  
  vector<int> q(n);
  for(int i=0;i<n;i++) q[p[i]]=i;
  
  auto NG=[&](){cout<<":("<<endl;exit(0);};
  string ans;
  stack<int> st;
  for(int i=0,k=0;i<n;i++){
    ans+='(';
    st.emplace(q[i]);
    while(!st.empty()&&st.top()==k){
      ans+=')';
      st.pop();
      k++;
    }    
  }
  
  if(!st.empty()) NG();
  cout<<ans<<endl;
  return 0;
}

