#include <algorithm>
#include <cstdio>
#include <vector>
#include <stack>

using namespace std;

bool mark[400000];
char s[400001];

int main()
{
    int N;
    scanf("%d", &N);

    vector<pair<int, int>> v;
    for (int i = 0; i < 2 * N; i++) {
        int x;
        scanf("%d", &x);
        v.emplace_back(x, i);
    }
    sort(v.begin(), v.end());
    for (int i = 0; i < N; i++) {
        mark[v[i].second] = true;
    }

    stack<int> st;
    for (int i = 0; i < 2 * N; i++) {
        if (st.size() == 0 || mark[st.top()] == mark[i]) st.push(i);
        else {
            s[st.top()] = '(';
            s[i] = ')';
            st.pop();
        }
    }

    printf("%s\n", s);
    return 0;
}
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;
const int N = 2e5 + 5;
int mod = 998244353;
int main(){
    ios::sync_with_stdio(0), cin.tie(0);
    int n;
    cin >> n;
    n *= 2;
    int a[n], tag[n];
    vector<pair<int, int>> v;
    for (int i = 0; i < n; i++) cin >> a[i], v.push_back({a[i], i});
    sort(v.begin(), v.end());
    for (int i = 0; i < n / 2; i++) tag[v[i].se] = 1;
    for (int i = n / 2; i < n; i++) tag[v[i].se] = -1;
    int ans[n]{}, pre[n + 1]{};
    map<int, queue<int>> v2;
    for (int i = 0; i < n; i++) pre[i + 1] = pre[i] + tag[i], v2[pre[i + 1]].push(i);
    for (int i = 0; i < n; i++){
        if (ans[i]) continue;
        ans[i] = 1;
        v2[pre[i + 1]].pop();
        int p = v2[pre[i]].front();
        v2[pre[i]].pop();
        ans[p] = 2;
        //cout << pre[i] << ' ' << p << '\n';
    }
    for (int i = 0; i < n; i++) cout << (ans[i] == 1 ? '(' : ')');
}