#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include <map>
#include <fstream>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <assert.h>
#include <complex>
using namespace std;
#define LONG_INF 10000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353LL
#define seg_size 65536*4
#define REP(i,n) for(long long i = 0;i < n;++i)
int main() {
	string s;
	int n;
	cin >> n;
	vector<int> a;
	REP(i, n) {
		int tmp;
		cin >> tmp;
		a.push_back(tmp);
	}
	reverse(a.begin(), a.end());
	stack<int> now;
	int now_itr = n;
	for (int i = 0; i < n; ++i) {
		s.push_back('(');
		now.push(a[i]);
		while (now.empty() == false && now.top() == now_itr) {
			now_itr--;
			now.pop();
			s.push_back(')');
		}
	}
	if (now_itr != 0) {
		cout << ":(" << endl;
		return 0;
	}
	reverse(s.begin(), s.end());
	REP(i, s.length()) {
		if (s[i] == '(') s[i] = ')';
		else s[i] = '(';
	}
	cout << s << endl;
	return 0;
}
