#include<bits/stdc++.h>
using namespace std;
#define Max(a,b) ((a)<(b))&&((a)=(b))
#define Min(a,b) ((a)>(b))&&((a)=(b))
#define LL long long
#define db double
bool f1;
inline int rd() {
	int res=0;
	char ch;
	while(ch=getchar(),ch<48||ch>57);
	do res=(res<<1)+(res<<3)+(ch^48);
	while(ch=getchar(),ch>47&&ch<58);
	return res;
}
const int M=4e5+5;
int n;
int A[M];
struct info {
	int x,num;
	bool operator <(const info &_) const {
		if(x^_.x)return x<_.x;
		return num<_.num;
	}
}P[M];
int l[M],r[M];
int topl,topr;
char S[M];
bool f2;
int main() {
//	printf("%lf\n",(&f2-&f1)/1024.0/1024.0);
//	freopen("a.in","r",stdin);
//	freopen("a.out","w",stdout);
	n=rd();
	for(int i=1; i<=n*2; ++i) A[i]=rd(),P[i]=(info)<%A[i],i%>;
	sort(P+1,P+n*2+1);
	for(int i=1; i<=n*2; ++i) {
		int ss=lower_bound(P+1,P+n*2+1,(info)<%A[i],i%>)-P;
		if(ss<=n) {
			if(topr)S[r[topr--]]='(',S[i]=')';
			else l[++topl]=i;
		}else {
			if(topl)S[l[topl--]]='(',S[i]=')';
			else r[++topr]=i;	
		}
	}for(int i=1; i<=n*2; ++i)printf("%c",S[i]);
	return 0;
}

#include<iostream>
#include<iomanip>

#include<cmath>
#include<algorithm>
#include<numeric>

#include<vector>
#include<string>
#include<set>
#include<map>
#include<stack>
#include<cassert>
//#include<atcoder/all>

#define fi first
#define se second
#define pb(x) emplace_back(x)

using namespace std;
using ll = long long;
using v_ll = vector <ll>;
using vv_ll = vector <v_ll>;

ll max(ll x,ll y){return x>y?x:y;}
ll min(ll x,ll y){return x<y?x:y;}
template<class T> bool chmax(T& x,const T& y){ if (x>=y) return false; x=y; return true;}
template<class T> bool chmin(T& x,const T& y){ if (x<=y) return false; x=y; return true;}
template<class T> void quit(T x){std::cout << x << "\n"; exit(0);}

template<typename T> void vshow(T x){for(auto itr = x.begin();itr!=x.end();itr++){std::cerr << *itr << " ";} std::cerr << "\n";}
template<typename T> void vvshow(T x){for(auto itr = x.begin();itr!=x.end();itr++){vshow(*itr);} std::cerr << "\n";}

int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll N;
  cin >> N;
  v_ll A(2*N,0),B(2*N,0),C(2*N,0);
  for(ll i=0;i<2*N;i++){
    cin >> A[i];
    B[i]=A[i];
    // C[i]=B[i];
  }
  sort(B.begin(),B.end());
  ll th = B[N];
  ll cnt1=0;
  for(ll i=0;i<2*N;i++){
    if (A[i]>th)cnt1++;
  }
  for(ll i=0;i<2*N;i++){
    if (A[i]>th || (A[i]==th && cnt1<N)){
      if (A[i]==th) cnt1++;
      A[i]=1;
    }
    else {A[i]=0;}
  }
  stack<ll>S;
  string ans="";
  for(ll i=0;i<2*N;i++){
    if (S.empty()){ans.push_back('('); S.push(A[i]);}
    else if (S.top()==A[i]) {ans.push_back('('); S.push(A[i]);}
    else {ans.push_back(')'); S.pop();}
  }
  cout << ans << "\n";
}


