#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define ins insert

#define debug(a) cerr<<(a)<<endl
#define dbrep(a,n) rep(_i,n) cerr<<(a[_i])<<" "; cerr<<endl
#define dbrep2(a,n,m) rep(_i,n){rep(_j,m) cerr<<(a[_i][_j])<<" "; cerr<<endl;}

using namespace std;

template<class A, class B>
ostream &operator<<(ostream &os, const pair<A,B> &p){return os<<"("<<p.fi<<","<<p.se<<")";}
template<class A, class B>
istream &operator>>(istream &is, pair<A,B> &p){return is>>p.fi>>p.se;}

template<class T>
vector<T> make_vec(size_t a){
	return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
	return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

/* Some Libraries */

//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin>>N;
    vi a(2*N);
    rep(i,2*N) cin>>a[i];
    vector<pi> b;
    rep(i,2*N){
        b.emplace_back(a[i],i);
    }
    vector<bool> marked(2*N);
    sort(rall(b));
    rep(i,N) marked[b[i].se]=true;
    
    stack<bool> st; 
    string S="";
    rep(i,N){
        bool f1 = marked[2*i];
        bool f2 = marked[2*i+1];
        if (f1 xor f2){
            S+="()";
        }else{
            if (!st.empty() && (st.top() xor f1)){
                st.pop();
                S+="))";
            }else{
                if (f1) st.push(true);
                else st.push(false);
                S+="((";
            }
        }
    }
    cout<<S<<"\n";

    return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
#include <cmath>
#include <map>

using ll=long long;
using namespace std;

int main(){
    int N;
    cin>>N;
    N*=2;
    vector<ll> A(N);
    for(int i=0;i<N;i++){
        cin>>A[i];
    }

    vector<ll> B = A;
    sort(B.begin(), B.end());

    map<ll,int> cnt;
    for(int i=0;i<N/2;i++){
        cnt[B[i]]++;
    }

    vector<int> col(N,0);
    for(int i=0;i<N;i++){
        if(cnt[A[i]] > 0){
            col[i] = 1;
            cnt[A[i]]--;
        }
    }

    vector<int> ans(N,-1);
    vector<int> st;
    st.push_back(-1);
    for(int i=0;i<N;i++){
        if(*st.rbegin() == -1){
            ans[i] = 0;
            st.push_back(col[i]);
        }else if(*st.rbegin() == col[i]){
            ans[i] = 0;
            st.push_back(col[i]);
        }else{
            ans[i] = 1;
            st.pop_back();
        }
    }

    for(int i=0;i<N;i++){
        if(ans[i]){
            cout<<")";
        }else{
            cout<<"(";
        }
    }
    cout<<endl;
    
    return 0;
}