#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define chmin(x,y) x = min((x),(y))
#define chmax(x,y) x = max((x),(y))
#define popcount(x) __builtin_popcount(x)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
const int INF = 1e9;
const long long LINF = 1e17;
const int MOD = 1000000007;
//const int MOD = 998244353;
const double PI = 3.14159265358979323846;

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

    vector<ll> a(2*n);
    rep(i,2*n) cin >> a[i];

    vector<int> id(2*n);
    iota(id.begin(),id.end(),0);
    sort(id.begin(),id.end(),[&](int l,int r){
        return a[l] < a[r];
    });
    vector<int> revid(2*n);
    rep(i,2*n) revid[id[i]] = i;

    stack<int> st;
    string ans = "";
    rep(i,2*n){
        int t = revid[i] < n ? 0 : 1;
        if(st.empty()){
            ans += "(";
            st.push(t);
        }else{
            if(st.top() == 1-t){
                ans += ')';
                st.pop();
            }else{
                ans += '(';
                st.push(t);
            }
        }
    }
    cout << ans << endl;

    return 0;
}
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <vector>

typedef long long ll;
typedef unsigned long long ull;
typedef long double LD;
typedef std::pair<int, int> pii;
const int INF = 2147483647;
const int INF2 = 0x3f3f3f3f;
const ll INF64 = (ll)1e18;
const double INFD = 1e30;
const double EPS = 1e-9;
const double PI = std::acos(-1);
const int MOD = 998244353;
template <typename T>
inline T read() {
    T X = 0, w = 0;
    char ch = 0;
    while (!isdigit(ch)) {
        w |= ch == '-';
        ch = getchar();
    }
    while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
    return w ? -X : X;
}
const int MAXN = 400005;
const int MAXV = (1 << 17) + 5;
int n, m, k;
int dr[4] = {0, 1, 0, -1};
int dc[4] = {-1, 0, 1, 0};
int dr2[8] = {1, 1, 1, -1, -1, -1, 0, 0};
int dc2[8] = {1, 0, -1, 1, 0, -1, 1, -1};
int CASE = 1;
int A[MAXN];
int B[MAXN];

pii st[MAXN];
char ans[MAXN];
int top;
int main() {
#ifdef LOCALLL
    freopen("in", "r", stdin);
    freopen("out", "w", stdout);
#endif
    scanf("%d", &n);
    n *= 2;
    for (int i = 1; i <= n; i++) {
        A[i] = read<int>();
        B[i] = A[i];
    }
    std::sort(B + 1, B + n + 1);
    int L = B[n / 2], R = B[n / 2 + 1];
    int smalleq = 0;
    for (int i = 1; i <= n / 2; i++) {
        if (B[i] == L) smalleq++;
    }
    for (int i = 1; i <= n; i++) {
        bool small = A[i] < L || (A[i] == L && smalleq > 0);
        if (A[i] == L && smalleq > 0) smalleq--;
        if (top != 0 && st[top].first != small) {
            ans[i] = ')';
            ans[st[top].second] = '(';
            top--;
        } else {
            st[++top] = {small, i};
        }
    }
    for (int i = 1; i <= n; i++) {
        printf("%c", ans[i]);
    }
    printf("\n");
    return 0;
}
