#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;
const int N = 2e5 + 5;
int mod = 998244353;
int main(){
    ios::sync_with_stdio(0), cin.tie(0);
    int n;
    cin >> n;
    n *= 2;
    int a[n], tag[n];
    vector<pair<int, int>> v;
    for (int i = 0; i < n; i++) cin >> a[i], v.push_back({a[i], i});
    sort(v.begin(), v.end());
    for (int i = 0; i < n / 2; i++) tag[v[i].se] = 1;
    for (int i = n / 2; i < n; i++) tag[v[i].se] = -1;
    int ans[n]{}, pre[n + 1]{};
    map<int, queue<int>> v2;
    for (int i = 0; i < n; i++) pre[i + 1] = pre[i] + tag[i], v2[pre[i + 1]].push(i);
    for (int i = 0; i < n; i++){
        if (ans[i]) continue;
        ans[i] = 1;
        v2[pre[i + 1]].pop();
        int p = v2[pre[i]].front();
        v2[pre[i]].pop();
        ans[p] = 2;
        //cout << pre[i] << ' ' << p << '\n';
    }
    for (int i = 0; i < n; i++) cout << (ans[i] == 1 ? '(' : ')');
}
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<iomanip>


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


int main(){
    ll N;
    cin>>N;
    N*=2;
    v A(N);
    rep(i,0,N)cin>>A[i];
    v As=A;
    sort(all(As));
    ll mid = -1;
    ll midl = 0, midr = 0;
    if(As[N/2] == As[N/2-1]){
        mid = As[N/2];
    }
    map<ll,ll> m;
    rep(i,0,N){
        if(As[i]!=mid){
            if(i<N/2)m[As[i]]--;
            else m[As[i]]++;
        }
        else{
            m[As[i]] = 999999;
            if(i<N/2)midl++;
            else midr++;
        }
    }
    //cout<<m[1]<<m[4]<<endl;
    ll now = 0;
    ll nowL = 0;
    rep(i,0,N){
        //cout<<A[i]<<m[A[i]]<<endl;
        if(m[A[i]] == 999999){
            if(now > 0){
                if(midl > 0){
                    cout<<")";
                    nowL--;
                    if(nowL == 0)now = 0;
                    midl--;
                }
                else{
                    now = 1;
                    cout<<"(";
                    nowL++;
                    midr--;
                }
            }
            else if(now < 0){
                if(midr > 0){
                    cout<<")";
                    nowL--;
                    if(nowL == 0)now = 0;
                    midr--;
                }
                else{
                    now = -1;
                    cout<<"(";
                    nowL++;
                    midl--;
                }
            }
            else{
                cout<<"(";
                nowL++;
                if(midr==0){
                    now = -1;
                    midl--;
                }
                else if(midl == 0){
                    now = 1;
                    midr--;
                }
                else{
                    if(m[A[i+1]] == 999999 || m[A[i+1]] > 0){
                        now = -1;
                        midl--;
                    }
                    else{
                        now = 1;
                        midr--;
                    }
                }
            }

        }
        else if(m[A[i]] < 0){
            if(now <= 0){
                now = -1;
                cout<<"(";
                nowL++;
            }
            else{
                cout<<")";
                nowL--;
                if(nowL == 0)now = 0;
            }
        }
        else{
            if(now >= 0){
                now = 1;
                cout<<"(";
                nowL++;
            }
            else {
                cout<<")";
                nowL--;
                if(nowL == 0)now = 0;
            }
        }

    }
    return 0;
}