#include<bits/stdc++.h>
using namespace std;
#define rint register int
#define ll long long
#define rll register long long
const int N=4e5+10;
int a[N],pos[N];
map<int,int> cnt;
int main(){
	rint n;
	scanf("%d",&n);n<<=1;
	for(rint i=1;i<=n;i++)
		scanf("%d",&a[i]),cnt[a[i]]++;
	rint s=0;
	for(auto &v:cnt){
		v.second+=s;
		s=v.second;
	}
	for(rint i=1;i<=n;i++)
		pos[i]=cnt[a[i]]--;
	rint now=0;
	for(rint i=1;i<=n;i++){
		if(pos[i]<=n/2){
			if(now>=0)putchar('(');
			else putchar(')');
			now++;
		}else {
			if(now<=0)putchar('(');
			else putchar(')');
			now--;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;

const int MAXN=400005;
const ll mod=998244353;

ll n,tag[MAXN];
pair<ll,ll> p[MAXN];

int main(){
	scanf("%lld",&n);
	for(ll i=1;i<=2*n;i++){
		scanf("%lld",&p[i].first);
		p[i].second=i;
	}
	sort(p+1,p+2*n+1);
	for(ll i=n+1;i<=2*n;i++){
		tag[p[i].second]=1;
	}
	ll cntl=0,cntr=0;
	for(ll i=1;i<=2*n;i++){
		if(tag[i]==0){
			if(cntl==0&&cntr==0){
				cntl++;
				printf("(");
			}
			else if(cntl>0&&cntr==0){
				cntl++;
				printf("(");
			}
			else if(cntl==0&&cntr>0){
				cntr--;
				printf(")");
			}
		}
		else if(tag[i]==1){
			if(cntl==0&&cntr==0){
				cntr++;
				printf("(");
			}
			else if(cntl>0&&cntr==0){
				cntl--;
				printf(")");
			}
			else if(cntl==0&&cntr>0){
				cntr++;
				printf("(");
			}
		}
	}

	return 0;
}
