#include<bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ll long long
#define db double
#define el "\n"
#define ld long double
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n;i>=0;i--)
#define rep_a(i,a,n) for(int i=a;i<n;i++)
#define all(ds) ds.begin(), ds.end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
typedef vector< long long > vi;
typedef pair<long long, long long> ii;
typedef priority_queue <ll> pq;
#define o_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 

const ll mod = 1000000007;
const ll INF = (ll)1e18;
const ll MAXN = 1000006;

ll po(ll x, ll n){ 
    ll ans=1;
    while(n>0){ if(n&1) ans=(ans*x)%mod; x=(x*x)%mod; n/=2;}
    return ans;
}


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int T=1;
    //cin >> T;
    while(T--){
    
        int n;
        cin>>n;
        n*=2;
        vector<ii> v;
        ll x;
        rep(i,n){
            cin>>x;
            v.pb(mp(x,i));
        }
        sort(all(v));

        int b[n];
        rep(i,n/2) b[v[i].ss]=0;
        rep_a(i,n/2,n) b[v[i].ss]=1;

        int cnt = 0, f;
        string s = "";
        rep(i,n){
            if(cnt==0){
                f=b[i];
            }
            if(b[i]==f){
                cnt++;
                s+='(';
            }
            else{
                cnt--;
                s+=')';
            }
        }

        cout<<s<<el;
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
    return 0;
}
#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef pair<int, int> pi;

const int maxn = 4e5 + 5;
int n;
int a[maxn];
pi b[maxn];
int col[maxn];
int S[maxn];

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n;
    for(int i = 1;i <= n * 2;i++){
        cin >> a[i];
        b[i] = mp(a[i], i);
    }
    sort(b + 1, b + 1 + 2 * n);
    for(int i = 1;i <= 2 * n;i++){
        int j = b[i].se;
        col[j] = (i > n);
    }
    stack<int> st;
    for(int i = 1;i <= 2 * n;i++){
        if(st.size() > 0 and col[st.top()] + col[i] == 1){
            S[i] = 1;
            S[st.top()] = 0;
            st.pop();
        }else{
            st.push(i);
        }
    }
    string ans = "";
    for(int i = 1;i <= 2 * n;i++){
        ans.push_back(S[i] ? ')' : '(');
    }
    cout << ans << endl;
    return 0;
}
