#include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

// #define DEBUG_MODE
#ifdef DEBUG_MODE
#define dump(x) cout << #x << " : " << x << endl
#define LINE cout << "line : " << __LINE__ << endl
#define dumpV(v) cout << #v << " : ["; for(auto& t : v) cout << t << ", "; cout<<"]" << endl
#define STOP assert(false)
#else
#define dump(x) ;
#define LINE     ;
#define dumpV(v);
#define STOP     ;
#endif
#define mp make_pair

namespace std{
  template<class S,class T>
  ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.fi<<", "<<a.se<<')';
    return out;
  }
}


string s;

vector<pii> u;
void calc(int& i) {
    if(i == s.size()) return;
    assert(s[i] == '(');
    int l = i;
    ++i;
    while(s[i] == '(') calc(i);
    assert(s[i] == ')');
    u.push_back(make_pair(l, i));
    ++i;
    // cout << l << " " << i << endl;
}

int main(){
    int n;
    cin >> n;
    vector<pii> v(n);
    rep(i, n) {
        int j;
        cin >> j;
        --j;
        v[i] = make_pair(j, i);
    }
    sort(all(v));
    priority_queue<int,vector<int>,greater<int> > q;
    int cur = 0;
    rep(i, n) {
        s += '(';
        q.push(v[i].se);
        while(q.top() == cur) {
            q.pop();
            ++cur;
            s+=')';
        }
    }
    int id = 0;
    while(id < s.size()) calc(id);

    dumpV(u);

    {
        map<int, int> mp;
        for(auto&& p : u) mp[p.se] = 1;
        int cnt = 0;
        for(auto&& p : mp) p.se = cnt++;
        for(auto&& p : u) p.se = mp[p.se];
    }
    {
        map<int, int> mp;
        for(auto&& p : u) mp[p.fi] = 1;
        int cnt = 0;
        for(auto&& p : mp) p.se = cnt++;
        for(auto&& p : u) p.fi = mp[p.fi];
    }
    sort(all(u));
    if(v == u) cout << s <<endl;
    else cout << ":(" << endl;

    dump(s);
    dumpV(v);
    dumpV(u);
    return 0;
}
