#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


int get_num(char buf[7]){

	int ret = 0;

	for(int i = 0; buf[i] != '\0'; i++){

		ret = 10*ret+(buf[i]-'0');
	}

	return ret;
}


int main(){

	int N;
	scanf("%d",&N);

	queue<char> ANS;

	int open_num = 0;
	stack<int> S;

	char buf[7];
	int tmp;

	for(int i = 0; i < N; i++){

		scanf("%s",buf);
		tmp = get_num(buf);

		while(open_num < tmp){ //閉じカッコの数と同じだけ開きカッコをpush
			ANS.push('(');
			S.push(++open_num);
		}

		if(tmp == S.top()){
			ANS.push(')');
			S.pop();
		}
	}

	if(!S.empty()){

		printf(":(\n");
		return 0;

	}else{

		while(!ANS.empty()){
			printf("%c",ANS.front());
			ANS.pop();
		}
		printf("\n");
	}

	return 0;
}

