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

#define ffor(i, a, b) for (int i = a ; i <= (int) b ; i++) 
#define rfor(i, a, b) for (int i = (int) a ; i >= b ; i--)  

#define vec vector 
#define PB push_back 

#define MP make_pair 
#define MT make_tuple 
#define F first 
#define S second 

using ll = long long int; // watch out for overflows in your code
using pii = pair<int,int>;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void debug() { cout << "\n"; };
template <typename T, typename... Targs> 
void debug(T t, Targs... args) {
    cout << t << " ";
    debug(args...);
}

template <typename T1, typename T2> 
inline ostream& operator << (ostream& os, const pair<T1,T2>& p) {
    return os << "(" << p.F << ", " << p.S << ")";
}

template <typename T> 
inline ostream& operator << (ostream& os, const vec<T>& v) {
    for(auto& t : v) {
        os << t << " ";
    }
    return os;
}

template <typename T> 
inline ostream& operator << (ostream& os, const vec<vec<T>>& m) {
    for(auto& v : m) {
        for(auto& t : v) {
            os << t << " ";
        }
        os << "\n";
    }
    return os;
}

template <typename T> 
inline ostream& operator << (ostream& os, const set<T>& v) {
    for(auto& t : v) {
        os << t << " ";
    }
    return os;
}

template <typename K, typename V> 
inline ostream& operator << (ostream& os, const map<K,V>& m) {
    for(auto& p : m) {
        os << p.F << " -> " << p.S << "\n";
    }
    return os;
}

int N;
vec<int> A;

vec<int> C;
void color() {
    vec<int> B(A.begin(), A.end());
    sort(B.begin()+1, B.end());
    map<int, deque<int>> idx;
    ffor(i, 1, 2*N) {
        idx[B[i]].PB(i);
    }
    C.assign(2*N+1, -1);
    ffor(i, 1, 2*N) {
        auto& dq = idx[A[i]];
        if(dq.front() >= N+1) {
            C[i] = 1; // 1 == black 
        }
        else {
            C[i] = 0; // 0 == white 
        }
        dq.pop_front();
    }
}

vec<char> ans;
void compute() {
    ans.assign(2*N+1, '.');
    stack<int> s;
    ffor(i, 1, 2*N) {
        if(s.empty()) {
            s.push(i);
        }
        else if(C[s.top()] != C[i]){
            ans[s.top()] = '(';
            ans[i] = ')';
            s.pop();
        }
        else {
            s.push(i);
        }
    }
}

////////////////////////////////////////////////////////////////////////

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    cin >> N;
    A.assign(2*N+1, 0);
    ffor(i, 1, 2*N) {
        cin >> A[i];
    }
    color();
    compute();
    ffor(i, 1, 2*N) {
        cout << ans[i];
    }
    cout << "\n";
}


#include "bits/stdc++.h"

using namespace std;

typedef long double ld;
typedef long long ll;

#define sz(x) (int)(x).size()
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define f first
#define s second

template<typename T, typename U> bool ckmin(T &a, const U &b){ return b < a ? a = b, true : false; }
template<typename T, typename U> bool ckmax(T &a, const U &b){ return b > a ? a = b, true : false; }

int n;
string res;
vector<int> v, pv;
vector<array<int, 2>> a;
map<int, vector<int>> st1, st0;
inline int qry(int l, int r){
    return pv[r + 1] - pv[l];
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n; n <<= 1; a.assign(n, {0, 0});
    v.assign(n, 0); pv.assign(n + 1, 0);
    res.assign(n, '.');
    for(int i = 0; i < n; ++i){
        cin >> a[i][0]; a[i][1] = i;
    }
    sort(a.begin(), a.end());
    for(int i = 0; i < n; ++i){
        if(i < n/2) v[a[i][1]] = 1;
        else v[a[i][1]] = -1;
    }
    for(int i = 0; i < n; ++i){
        pv[i + 1] = pv[i] + v[i];
    }
    assert(qry(0, n - 1) == 0);
    for(int i = n - 1; i >= 0; --i){
        if(v[i] == -1) st0[qry(0, i)].push_back(i);
        else st1[qry(0, i)].push_back(i);
    }
    for(int i = 0; i < n; ++i){
        if(res[i] != '.') continue;
        res[i] = '(';
        if(v[i] == -1){
            int pos = qry(0, i - 1);
            res[st1[pos].back()] = ')';
            st1[pos].pop_back();
            st0[qry(0, i)].pop_back();
        }
        else{
            int pos = qry(0, i - 1);
            res[st0[pos].back()] = ')';
            st0[pos].pop_back();      
            st1[qry(0, i)].pop_back();      
        }
    }
    cout << res;
    return 0;
}