#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> p(n);
	for(int i=0; i<n; i++){
		cin >> p[i];
	}
	vector<int> st(1, 0);
	int curr = 0;
	string ans = "";
	for(int i=0; i<n; i++){
		if(p[i] < st.back()){
			ans = ":(";
			break;
		}
		while(curr < p[i]){
			curr++;
			ans += "(";
			st.push_back(curr);
		}
		st.pop_back();
		ans += ")";
	}
	cout << ans << endl;
	return 0;
}
