#include <iostream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int p[100010];
vector<int> v;
string s;
int main(){
	int i,n;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> p[i];
	}
	v.push_back(1); s.push_back('(');
	int cnt = 2;
	for(i=0;i<n;i++){
		if(i!=0 && p[i] - p[i-1]==-1){
			v.pop_back();
			s.push_back(')');
		}else{
			while(1){
				int x = v.back();
				if(x<p[i]){
					v.push_back(cnt); cnt++;
					s.push_back('(');
				}else if(x==p[i]){
					v.pop_back(); s.push_back(')');
					break;
				}else{
					cout << ":(" << endl;
					return 0;
				}
			}
		}
	}
	cout << s << endl;
}
