#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;
}
#include <bits/stdc++.h>

#define ln                 '\n'
#define all(dat)           dat.begin(), dat.end()
#define loop(i, to)        for (int i = 0; i < to; ++i)
#define cont(i, to)        for (int i = 1; i <= to; ++i)
#define circ(i, fm, to)    for (int i = fm; i <= to; ++i)
#define foreach(i, dat)    for (__typeof(dat.begin()) i = dat.begin(); i != dat.end(); ++i)

typedef long long          num;

using namespace std;

const int nsz = 5e5;
bool d[nsz + 5];
char s[nsz + 5];
int n, a[nsz + 5];
pair<int, int> b[nsz + 5];
num ans;

inline void init() {
	cont (i, n) b[i] = make_pair(a[i], i);
	sort(b + 1, b + n + 1);
	cont (i, n / 2) {
		d[b[i].second] = 1;
	}
}

inline void solve() {
	static int stk[nsz + 5];
	int ss = 0;
	cont (i, n) {
		if (d[i]) {
			if (ss && stk[ss] > 0) {
				s[+stk[ss]] = '(', s[i] = ')';
				--ss;
			} else stk[++ss] = -i;
		} else {
			if (ss && stk[ss] < 0) {
				s[-stk[ss]] = '(', s[i] = ')';
				--ss;
			} else stk[++ss] = +i;
		}
	}
}

int main() {
	scanf("%d", &n), n *= 2;
	cont (i, n) scanf("%d", &a[i]);
	init();
	solve();
	printf("%s\n", s + 1);
}