#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

//#include <atcoder/convolution>
//#include <atcoder/modint> 
//using Modint = atcoder::modint998244353;

using namespace std;
typedef long long ll;

void ex_gcd(ll a, ll b, ll &d, ll &x, ll &y) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
  } else {
    ex_gcd(b, a % b, d, y, x);
    y -= a / b * x;
  }
}
ll inv(ll a, ll n) {
  ll d, x, y;
  ex_gcd(a, n, d, x, y);
  return d == 1 ? (x % n + n) % (n / d) : -1;
}
ll gcd(ll x, ll y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}

const int maxn = 400005;
const int mod = 998244353;

int a[maxn];
int idx[maxn], b[maxn];

int cal(int x, int n){
  return b[x]<n;
}

int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  int n;
  cin>>n;
  for(int i=0;i<n+n;i++){
    cin>>a[i];
    idx[i] = i;
  }
  sort(idx, idx+n+n,[](int x, int y){
    return a[x]<a[y];
  });
  for(int i=0;i<n+n;i++){
    b[idx[i]]=i;
  }
  string ret=string(n+n,' ');
  stack<int>st;
  for(int i=0;i<n+n;i++){
    if((!st.empty())&&cal(st.top(), n)!=cal(i, n)) {
      ret[st.top()]='(';
      ret[i]=')';
      st.pop();
    } else {
      st.push(i);
    }
  }
  cout<<ret<<endl;
  return 0;
}
#include<bits/stdc++.h>
using namespace std;

#define Mod(x) ((x>=P)&&(x-=P))
#define rep(i,a,b) for(int i=a,i##end=b;i<=i##end;++i)
#define drep(i,a,b) for(int i=a,i##end=b;i>=i##end;--i)
#define erep(i,a) for(int i=hd[a];i;nxt[i])

typedef long long ll;
void Max(int &x,int y){(x<y)&&(x=y);}
void Min(int &x,int y){(x>y)&&(x=y);}

bool vio;
char IO;
int rd(int res=0){
	bool f=0;
	while(IO=getchar(),IO<48||IO>57)
		f|=IO=='-';
	do res=(res<<1)+(res<<3)+(IO^48);
	while(IO=getchar(),isdigit(IO));
	return f?-res:res;
}
const int M=1e6+10;
int ans[M],stk[M],top,A[M],B[M],mk[M];
bool let;
int main(){
	cerr<<(&vio-&let)/1024.0/1024<<endl;
	int n=rd();
	rep(i,1,2*n)B[i]=A[i]=rd();
	sort(B+1,B+2*n+1);
	int t=n;
	rep(i,1,n*2){
		if(A[i]<B[n])mk[i]=1,t--;
		if(A[i]>B[n])mk[i]=2;
	}
	int fl=0;
	rep(i,1,n*2)if(t&&A[i]==B[n])mk[i]=1,t--;
	rep(i,1,2*n)if(!mk[i])mk[i]=2;
	rep(i,1,2*n){
		if(top){
			if(mk[i]==fl)stk[++top]=i;
			else ans[stk[top--]]=1,ans[i]=2;
		}else {
			fl=mk[i];
			stk[++top]=i;
		}
	}
	rep(i,1,2*n)putchar(ans[i]==1?'(':')');
}
