#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
//#define vec vector<ll>
//#define mat vector<vector<ll> >
#define fi first
#define se second
#define double long double
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
//typedef long double ld;
typedef complex<double> Complex;
const ll INF=1e9+7;
const ll MOD=998244353;
const ll inf=INF*INF;
const ll mod=MOD;
const ll MAX=200010;
const double PI=acos(-1.0);




signed main(){
    ll n;cin>>n;
    vector<ll>a(0),b(0);
    vector<ll>c(2*n);
    rep(i,2*n){
        cin>>c[i];
        if(i%2==0){
            a.pb(c[i]);
        }else{
            b.pb(c[i]);
        }
    }
    sort(all(a)),sort(rall(b));
    ll idx=-1;
    rep(i,n){
        if(b[i]<=a[i]){
            idx=i;
            break;
        }
    }
    string ans="";
    if(idx==-1){
        rep(i,n){
            ans+="()";
        }
    }else{
        map<ll,ll>aa;
        map<ll,ll>bb;
        rep(i,idx){
            aa[a[i]]++;
            bb[b[i]]++;
        }
        ll x=0,y=0,z=0,w=0;
        rep(i,n*2){
            if(i%2==0){
                if(y>0){
                    if(aa[c[i]]>0){
                        ans+=')';
                        aa[c[i]]--;
                        y--;
                    }else if(w>0){
                        w--;
                        ans+=')';
                    }else{
                        z++;
                        ans+='(';
                    }
                }else{
                    if(aa[c[i]]>0){
                        aa[c[i]]--;
                        ans+='(';
                        x++;
                    }else if(w>0){
                        w--;
                        ans+=')';
                    }else{
                        z++;
                        ans+='(';
                    }
                }
            }else{
                if(x>0){
                    if(bb[c[i]]>0){
                        ans+=')';
                        bb[c[i]]--;
                        x--;
                    }else if(z>0){
                        z--;
                        ans+=')';
                    }else{
                        w++;
                        ans+='(';
                    }
                }else{
                    if(bb[c[i]]>0){
                        bb[c[i]]--;
                        ans+='(';
                        y++;
                    }else if(z>0){
                        z--;
                        ans+=')';
                    }else{
                        w++;
                        ans+='(';
                    }
                }
            }
        }
    }
    cout<<ans<<endl;
}
#include<bits/stdc++.h>
using namespace std;

int get() {
	int x = 0, f = 1; char c = getchar();
	while(!isdigit(c)) { if(c == '-') f = -1; c = getchar(); }
	while(isdigit(c)) { x = x * 10 + c - '0'; c = getchar(); }
	return x * f;
}

const int N = 4e5 + 5;
int n, a[N], len, st[N], top, col[N];
pair<int, int> b[N];

int main() {
	n = get();
	for(int i = 1; i <= 2 * n; i++) a[i] = get(), b[i] = make_pair(a[i], i);
	sort(b + 1, b + 1 + 2 * n);
	for(int i = 1; i <= n; i++) col[b[i].second] = 0;
	for(int i = n + 1; i <= n + n; i++) col[b[i].second] = 1;
	for(int i = 1; i <= 2 * n; i++) {
		if(!top) st[++top] = i, printf("(");
		else if(col[st[top]] != col[i]) printf(")"), top--;
		else printf("("), st[++top] = i;
	}
	return 0;
}
