#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define each(e, v) for(auto &e: v)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) (int)x.size()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int MOD = 1000000007;
//const int MOD = 998244353;
const int inf = (1<<30)-1;
const ll INF = (1LL<<60)-1;
template<typename T> bool chmax(T &x, const T &y) {return (x < y)? (x = y, true) : false;};
template<typename T> bool chmin(T &x, const T &y) {return (x > y)? (x = y, true) : false;};

struct io_setup{
    io_setup(){
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout << fixed << setprecision(15);
    }
} io_setup;

int main(){
    int N; cin >> N;

    vector<ll> A(2*N);
    rep(i, 2*N) cin >> A[i];

    vector<int> p(2*N);
    vector<int> v(2*N);
    iota(all(v), 0);
    sort(all(v), [&](int i, int j){
        return A[i] > A[j];
    });

    set<int> s1[2], s2[2];
    vector<int> u(2*N, 0);

    rep(i, N){
        s1[v[i]&1].emplace(v[i]);
        u[v[i]] = 1;
    }
    rep(i, N){
        s2[v[N+i]&1].emplace(v[N+i]);
    }

    vector<bool> used(2*N, false);

    rep(i, 2*N){
        if(used[i]) continue;
        if(u[i] == 0){
            int j = *s1[(i&1)^1].begin();
            s2[(i&1)].erase(i);
            s1[(i&1)^1].erase(j);
            p[i] = j, p[j] = i;
            used[i] = true, used[j] = true;
        }
        else{
            int j = *s2[(i&1)^1].begin();
            s1[(i&1)].erase(i);
            s2[(i&1)^1].erase(j);
            p[i] = j, p[j] = i;
            used[i] = true, used[j] = true;
        }
    }

    //rep(i, 2*N) cout << u[i] << ' '; cout << '\n';
    //rep(i, 2*N) cout << p[i] << ' '; cout << '\n';

    string ans(2*N, ')');
    rep(i, 2*N){
        if(i < p[i]) ans[i] = '(';
    }

    cout << ans << '\n';
}
#include <bits/stdc++.h>
using namespace std;
const int N=4e5+2;
int stk[N],top;
int n,m,p,e,a[N],b[N];
int main()
{
	scanf("%d",&n);
	m=n<<1;
	for(int i=1;i<=m;++i)
	{
		scanf("%d",&a[i]);
		b[i]=a[i];
	}
	sort(b+1,b+m+1);
	for(int i=1;i<=m;++i)
		if(a[i]<b[n])++p;
		else if(a[i]>b[n])++e;
	for(int i=1;i<=m;++i)
	{
		int fl=0;
		if(a[i]>b[n])fl=1;
		else if(a[i]==b[n]&&p<n)++p;
		else if(a[i]==b[n]&&p==n)fl=1,++e;
		//else if(a[i]==b[n]&&!top)fl=1,++e;
		if(top&&stk[top]!=fl)putchar(')'),--top;
		else stk[++top]=fl,putchar('(');
	}
}
