#include <bits/stdc++.h>
#define arr array 
#define pb push_back
#define fs first 
#define sc second
#define eb emplace_back
#define vt vector
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

using namespace std;
typedef long long ll;
const int maxn=2e5;
const int MAXINT=1e9;
const ll MAXLL=1e18;


void solve(){
    int n;
    cin >> n;
    n*=2;
    vt<arr<int, 3>> a(n);
    rep(i, 0, n) cin >> a[i][0], a[i][1]=i;
    sort(a.begin(), a.end(), [&](arr<int, 3> x, arr<int, 3> y){
        return x[0]<y[0];
    });
    rep(i, 0, n/2) a[i][2]=1;
    rep(i, n/2, n) a[i][2]=0;
    sort(a.begin(), a.end(), [&](arr<int, 3> x, arr<int, 3> y){
        return x[1]<y[1];
    });
    
    //rep(i, 0, n) cout << a[i][2] << " "; cout << endl;
    vt<int> st;
    vt<char> ans(n);
    rep(i, 0, n){
        if (!st.empty()&&a[i][2]!=a[st.back()][2]) ans[st.back()]='(', ans[i]=')', st.pop_back();
        else st.pb(i);
    }
    rep(i, 0, n) cout << ans[i]; cout << endl;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int t=1;
    while(t--){
        solve();
    }
}
#include<bits/stdc++.h>
#define For(i,a,b) for(register int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(register int i=(a);i>=(b);--i)
#define int long long
using namespace std;
inline int read()
{
    char c=getchar();int x=0;bool f=0;
    for(;!isdigit(c);c=getchar())f^=!(c^45);
    for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
    if(f)x=-x;return x;
}

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;

#define mod 998244353
struct modint{
    int x;
    modint(int o=0){x=o;}
    modint &operator = (int o){return x=o,*this;}
    modint &operator +=(modint o){return x=x+o.x>=mod?x+o.x-mod:x+o.x,*this;}
    modint &operator -=(modint o){return x=x-o.x<0?x-o.x+mod:x-o.x,*this;}
    modint &operator *=(modint o){return x=1ll*x*o.x%mod,*this;}
    modint &operator ^=(int b){
        modint a=*this,c=1;
        for(;b;b>>=1,a*=a)if(b&1)c*=a;
        return x=c.x,*this;
    }
    modint &operator /=(modint o){return *this *=o^=mod-2;}
    modint &operator +=(int o){return x=x+o>=mod?x+o-mod:x+o,*this;}
    modint &operator -=(int o){return x=x-o<0?x-o+mod:x-o,*this;}
    modint &operator *=(int o){return x=1ll*x*o%mod,*this;}
    modint &operator /=(int o){return *this *= ((modint(o))^=mod-2);}
    template<class I>friend modint operator +(modint a,I b){return a+=b;}
    template<class I>friend modint operator -(modint a,I b){return a-=b;}
    template<class I>friend modint operator *(modint a,I b){return a*=b;}
    template<class I>friend modint operator /(modint a,I b){return a/=b;}
    friend modint operator ^(modint a,int b){return a^=b;}
    friend bool operator ==(modint a,int b){return a.x==b;}
    friend bool operator !=(modint a,int b){return a.x!=b;}
    bool operator ! () {return !x;}
    modint operator - () {return x?mod-x:0;}
};

#define maxn 500005
int n,a[maxn],id[maxn],col[maxn];
bool cmp(int x,int y){
	return a[x]<a[y];
}
queue< pii >q;
bool vis[maxn];
int pre[maxn],nxt[maxn];
char s[maxn];
void print(){
	For(i,1,n)if(!vis[i])cout<<a[i]<<' '; 
}
signed main()
{
	n=read()*2;
	For(i,1,n)a[i]=read(),id[i]=i;
	For(i,1,n-1)nxt[i]=i+1;
	For(i,2,n)pre[i]=i-1;
	sort(id+1,id+n+1,cmp);
	For(i,n/2+1,n)col[id[i]]=1;
	For(i,1,n-1)
		if(col[i]!=col[i+1])q.push(mkp(i,i+1));
	int orz=0;
	while(!q.empty()){
		pii t=q.front();q.pop();
		int u=t.fi,v=t.se;
		if(vis[u]||vis[v])continue;
		vis[u]=vis[v]=1;
	//	++orz,cout<<orz<<" "<<u<<' '<<v<<endl; 
	//	print();
		s[u]='(',s[v]=')';
		int uu=pre[u],vv=nxt[v];
		if(uu&&vv&&col[uu]!=col[vv]) q.push(mkp(uu,vv));
		nxt[pre[u]]=nxt[v];
		pre[nxt[v]]=pre[u];
		pre[u]=pre[v]=nxt[u]=nxt[v]=0;
	}
	For(i,1,n)if(!s[i])return -1;
	cout<<s+1;
	return 0;
}
