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

int main() {
	int N; cin >> N;
	vector<int> p(N) , q(N);
	for (int i = 0; i < N; ++i) cin >> p[i], --p[i], q[p[i]] = i;
	
	string res = "";
	int num = 0;
    stack<int> st;
	for (int i = 0; i < N; ++i) {
        res += "(";
        st.push(i);
        while (!st.empty() && q[st.top()] == num) {
            res += ")";
            ++num;
            st.pop();
        }
	}
	if (st.empty()) cout << res << endl;
	else cout << ":(" << endl;
}

