//#include<cstdio>
//#include<cassert>
//#include<iostream>
//#include<cstring>
//#include<algorithm>
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define MAX ((int)2e9 + 5)
#define MAXP ((int)1e5 + 5)
#define MAXL ((ll)1e18 + 5)
#define MAX_X ((int)2001)
#define MAX_Y ((int)2001)
#define pi acos(-1)
//#define MOD ((int)1e9 + 7)
#define MOD ((int)998244353 + 0)
#define BAS ((int)1e6 + 3)
//#define BAS ((int)2e5 + 3)
#define N ((int)4e5 + 9)
#define eps (1e-8)
#define fastio ios_base::sync_with_stdio(false),cin.tie(NULL)
#define logn 17
#define endl "\n"
#define mpp make_pair
#define BUCK 105
#define LEF (idx<<1)
#define RIG ((idx<<1)|1)
//#define int ll


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long ull;

/*fast io
ios_base::sync_with_stdio(false);
cin.tie(NULL);
*/




typedef tree < int,  null_type,  less < int >,  rb_tree_tag,  tree_order_statistics_node_update > o_set;
typedef tree < pair < int, int >,  null_type,  less < pair < int, int > >,  rb_tree_tag,  tree_order_statistics_node_update > o_setp;
/// o_set s;
/// s.order_of_key(k) : Number of items strictly smaller than k .
/// *(s.find_by_order(k)) : K-th element in a set (counting from zero).

typedef long double ldd;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int my_rand(int l, int r)
{
    return uniform_int_distribution<int>(l,r) (rng);
}

int  tar[N] , vis[N] , L[N] , R[N];

pair < int , int > arr[N];

queue < int > que;

void remv(int a , int b)
{
    int pa = L[a] , pb = R[b];
    R[pa] = pb;
    L[pb] = pa;
    a = pa , b = pb;
    if(tar[a] && !vis[a] && !tar[b]) que.push(a);
    if(tar[b] && !vis[b] && !tar[a]) que.push(b);
}

int main()
{
    fastio;
    int n;
    cin>>n;
    n += n;
    string str;
    for(int i = 1 ; i<=n ; i++) cin>>arr[i].first , arr[i].second = i, str += "@";
    str += "@";
    sort(arr + 1 , arr + n + 1);
    for(int i = n ; i > n/2 ; i--){
        tar[arr[i].second] = 1;
    }

    tar[0] = tar[n+1] = 1;
    L[0] = 0;
    R[0] = 1;
    L[n+1] = n;
    R[n+1] = n+1;
    vis[0] = vis[n+1] = 1;
    for(int i = 1 ; i<=n ; i++){
        L[i] = i-1 , R[i] = i+1;
        if(tar[i] && (!tar[i-1] || !tar[i+1])) que.push(i);
    }
    while(!que.empty()){
        int a = que.front();
//        cout<<a<<" ";
        que.pop();
        if(vis[a]) continue;
//        cout<<a<<" ";

        if(L[a] > 0 && !tar[L[a]]){
            str[L[a]] = '(';
            str[a] = ')';
            remv(L[a] , a);
            vis[a] = 1;
        }
        else if(R[a] <= n && !tar[R[a]]){
            str[a] = '(';
            str[R[a]] = ')';
            remv(a,R[a]);
            vis[a] = 1;
        }
    }
    for(int i = 0 ; i<n ; i++) str[i] = str[i+1];
    str.pop_back();
    cout<<str<<endl;
    return 0;
}

#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
  int N; cin>>N;
  vector<pair<int,int>> A(2*N);
  for(int i=0;i<2*N;i++){
    cin>>A[i].first; A[i].second=i;
  }
  sort(A.begin(),A.end());
  vector<int> B(2*N);
  for(int i=0;i<N;i++) B[A[i].second]=1;
  string C(2*N,'(');
  stack<pair<int,int>> st;
  for(int i=0;i<2*N;i++){
    if(st.size()==0 || st.top().first==B[i]) st.push({B[i],i});
    else st.pop(),C[i]=')';
  }
  cout<<C<<endl;
}