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

const int maxn = 2e5+8, inf = 1e18+9, mod = 1e9+7;

char ans[maxn * 2];
struct node { int v, id, b; } a[maxn * 2];
int n, m;

void solve() {
    int i, j, cnt = 0;
    cin >> n;
    for (i = 1; i <= (n * 2); i++) cin >> a[i].v, a[i].id = i;
    sort(a + 1, a + n * 2 + 1, [](node &o1, node &o2) { return o1.v < o2.v; });
    for (i = 1; i <= (n * 2); i++) a[i].b = (i <= n) ? -1 : 1;
    sort(a + 1, a + n * 2 + 1, [](node &o1, node &o2) { return o1.id < o2.id; });
    for (i = 1; i <= (n * 2); i++) {
        if (cnt * a[i].b < 0) ans[i] = ')';
        else ans[i] = '(';
        cnt += a[i].b;
    }
    cout << ans + 1 << endl;
}

signed main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); //cout << fixed << setprecision(15);
    int t = 1; //cin >> t;
    while (t--) solve();
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;

int main() {
    int N; cin>>N;
    vi A(2*N);
    for (int i = 0; i < 2*N; i++)cin >> A[i];

    vector<pair<int,int>> B(2*N);
    for (int i = 0; i < 2*N; i++)B[i] = make_pair(A[i], i);
    sort(B.begin(),B.end());

    string S(2*N, '#');
    for (int i = 0; i < N; i++)S[B[i].second] = '-';
    for (int i = N; i < 2*N; i++)S[B[i].second] = '+';

    stack<int> sp, sm;
    vector<pair<int,int>> vp;
    for (int i = 0; i < 2*N; i++){
        if(S[i]=='-'){
            if(!sp.empty()){
                vp.push_back(make_pair(sp.top(), i));
                sp.pop();
            }else{
                sm.push(i);
            }
        }else{
            if(!sm.empty()){
                vp.push_back(make_pair(sm.top(), i));
                sm.pop();
            }else{
                sp.push(i);
            }
        }
    }

    string ans = string(2*N, '#');
    for(auto e:vp){
        auto [l, r] = e;
        ans[l] = '(';
        ans[r] = ')';
    }
    cout << ans << endl;
}
