#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 998244353;

long long int N, M, K, H, W, L, R;
//int N, M, K, H, W, L, R


int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N;
	vector<int>p(N + 1);
	vector<int>v(N + 1);
	for (int i = 1; i <= N; i++) {
		cin >> p[i];
		v[p[i]] = i;
	}
	vector<long long int>closed(N + 1);
	vector<long long int>place(N + 1);
	vector<long long int>op(N + 1);
	for (int i = 1; i <= N; i++)place[i] = closed[i] = i * MOD;
	int m = N;
	for (int i = N; i >= 1; i--) {
		op[i] = --place[min(v[i], m)];
		m = min(m, v[i]);
	}
	//for (int i = 1; i <= N; i++)cout << v[i] << endl;
	vector<pair<long long int, int>>ret;
	for (int i = 1; i <= N; i++) {
		ret.push_back({ op[i],1 });
		ret.push_back({ closed[i],-1 });
	}
	sort(ret.begin(), ret.end());
	vector<int>box(N + 1);
	stack<int>st;
	int usedop = 1;
	int usedcl = 1;
	for (int i = 0; i < ret.size(); i++) {
		if (ret[i].second == 1)st.push(usedop++);
		else {
			box[st.top()] = usedcl++;
			st.pop();
		}
	}
	if (v != box) {
		cout << ":(\n";
		return 0;
	}
	for (auto i : ret) {
		if (i.second == 1)cout << '(';
		else cout << ')';
	}
	cout << endl;
}
