#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn=401000;
int n;
int a[maxn],rk[maxn];
bool type[maxn];
int scnt,stype;
inline int read(){
    int res=0;
    char ch=getchar(),ch1=ch;
    while(!isdigit(ch))ch1=ch,ch=getchar();
    while(isdigit(ch))res=res*10+ch-'0',ch=getchar();
    return ch1=='-'?-res:res;
}
int main(){
    n=read();
    for(int i=1;i<=(n<<1);++i)rk[i]=a[i]=read();
    sort(rk+1,rk+1+(n<<1));
    int cnt=0;
    for(int i=1;i<=(n<<1);++i){
        if(a[i]>rk[n+1]){
            ++cnt;type[i]=true;
        }
    }
    for(int i=1;i<=(n<<1);++i){
        if(a[i]==rk[n+1]){
            ++cnt;type[i]=true;
            if(cnt==n)break;
        }
    }
    for(int i=1;i<=(n<<1);++i){
        if(!scnt){
            ++scnt;stype=type[i];
            putchar('(');
        }
        else{
            if(stype!=type[i])--scnt,putchar(')');
            else ++scnt,putchar('(');
        }
    }
    return 0;
}
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a,i##end=b;i<=i##end;i++)
#define drep(i,a,b) for(int i=a,i##end=b;i>=i##end;i--)
inline int read() {
	int x=0,f=1;char c=getchar();
	while(c<48||c>57){if(c=='-')f=-1;c=getchar();}
	while(c>=48&&c<=57)x=(x<<1)+(x<<3)+(c^48),c=getchar();
	return x*f;
}
using namespace std;
typedef long long ll;
const int M=1e6+5,mod=1e9+7;
vector <int> E[M];
int A[M],B[M];
int n;
int Q(int a,int b=mod-2){
	int ans=1;
	for(;b;a=1ll*a*a%mod,b>>=1)if(b&1)ans=1ll*ans*a%mod;
	return ans;
}
void init(int m) {
	rep(i,1,m){
		int u=read(),v=read();
		E[u].push_back(v),E[v].push_back(u);
	}
}
void graph(){n=read();init(read());}
void tree(){n=read();init(n-1);}

int Mod[M],rest[M];
void exgcd(ll a,ll b,ll &x,ll &y){
    if(!b){
        x=1,y=0;
        return ;
    }
    exgcd(b,a%b,y,x);
    y-=a/b*x;
}
ll inv(ll a,ll b){
    ll x,y;
    exgcd(a,b,x,y);
    return (x%b+b)%b;
}
void CRT() {
    ll mul=1;
    rep(i,1,n)mul*=Mod[i];
    ll ans=0;
    rep(i,1,n){
		ll m=mul/Mod[i],tmp=inv(m,rest[i]);
		(ans+=Mod[i]*m*tmp)%=mul;
    }
}
struct node {
	int id;ll num;
	bool operator <(const node &a)const {
		if(num!=a.num)return num>a.num;
		return id<a.id;
	}
};
int T[M];
int query(int x,int ans=0){
	while(x<=n)ans+=T[x],x+=x&-x;
	return ans;
}
void add(int x){
	while(x)T[x]++,x-=x&-x;
}
int mk[M],st[M],mat[M];
void solve() {
	n=read()<<1;
	rep(i,1,n)A[i]=B[i]=read();
	sort(B+1,B+1+n);
	int mid=n/2,tot=0;
	rep(i,1,n)if(tot<mid&&A[i]<B[mid])tot++,mk[i]=1;
	rep(i,1,n)if(tot<mid&&A[i]==B[mid])tot++,mk[i]=1;
	
	bool op;int tp=0;
	rep(i,1,n){
		if(mk[i]){
			if(!tp)st[++tp]=i,op=1;
			else if(op==1)st[++tp]=i;
			else {
				int tmp=st[tp];
				mat[tmp]=i;
				mat[i]=tmp;
				tp--;
			}
		}else {
			if(!tp)st[++tp]=i,op=0;
			else if(op==0)st[++tp]=i;
			else {
				int tmp=st[tp];
				mat[tmp]=i;
				mat[i]=tmp;
				tp--;
			}
		}
	}
	rep(i,1,n){
		if(mat[i]>i)putchar('(');
		else putchar(')');
	}
}
int main() {
	int T=1;
	while(T--)solve();
	return 0;
}
