#include<bits/stdc++.h>
#define LL long long
#define dl double
#define P pair<int,int>
#define SZ(a) ((int)a.size())
using namespace std;

const int N = 4e5 + 10;

int n,a[N],id[N];
bool cmp(const int &x,const int &y){return a[x] < a[y];}
bool c[N];

int main(){
  // freopen("in.txt","r",stdin);
  // freopen("o.txt","w",stdout);
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  cin >> n;n *= 2;
  for(int i = 1;i <= n;i++)cin >> a[i],id[i] = i;
  sort(id + 1,id + n + 1,cmp);
  for(int i = 1;i <= n / 2;i++)c[id[i]] = 0;
  for(int i = n / 2 + 1;i <= n;i++)c[id[i]] = 1;
  int cnt = 0;
  for(int i = 1;i <= n;i++){
    if(c[i] == 0){
      if(cnt < 0)cout << ')';
      else cout << '(';
      cnt++;
    }
    else {
      if(cnt > 0)cout << ')';
      else cout << '(';
      cnt--;
    }
  }
  return 0;
}
/**/
#include<iostream>
#include<algorithm>
using namespace std;
int N;
pair<int,int>A[4<<17];
bool lo[4<<17];
main()
{
	cin>>N;
	for(int i=0;i<2*N;i++)
	{
		cin>>A[i].first;
		A[i].second=i;
	}
	sort(A,A+2*N);
	for(int i=0;i<N;i++)lo[A[i].second]=true;
	string ans="";
	int now=0;
	bool up;
	for(int i=0;i<2*N;i++)
	{
		if(now==0)
		{
			up=lo[i];
			ans+='(';
			now++;
		}
		else
		{
			if(up==lo[i])
			{
				ans+='(';
				now++;
			}
			else
			{
				ans+=')';
				now--;
			}
		}
	}
	cout<<ans<<endl;
}
