#include <bits/stdc++.h>

#define int long long

using namespace std;

const int MAXN = 4e5 + 100;

int A[MAXN];

char res[MAXN];

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int N;
    cin >> N;

    vector<pair<int,int>> vect;

    for(int i = 1 ; i <= 2*N ; i++)
    {
    	int n;
    	cin >> n;
    	vect.push_back({n,i});
    }

    sort(vect.begin(), vect.end());

    for(int i = 1 ; i <= N ; i++)
    {
    	A[vect[i-1].second] = 1;
    }

    vector<int> vvv;

    bool flag = false;

    for(int i = 1 ; i <= 2*N ; i++)
    {
    	if(flag == false)
    	{
    		if(A[i])
    		{
    			vvv.push_back(i);
    		}
    		else
    		{
    			if(vvv.size())
    			{
    				res[vvv.back()] = '(';
    				res[i] = ')';
    				vvv.pop_back();
    			}
    			else
    			{
    				flag = true;
    				vvv.push_back(i);
    			}
    		}
    	}
    	else
    	{
    		if(!A[i])
    		{
    			vvv.push_back(i);
    		}
    		else
    		{
    			if(vvv.size())
    			{
    				res[vvv.back()] = '(';
    				res[i] = ')';
    				vvv.pop_back();
    			}
    			else
    			{
    				flag = false;
    				vvv.push_back(i);
    			}
    		}
    	}
    }

    for(int i = 1 ; i <= 2*N ; i++)
    {
    	cout << res[i];
    }
    cout << '\n';

    return 0;
}
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define pre(i,a,b) for(int i=a;i>=b;i--)
#define N 400005
using namespace std;
int n,a[N],c[N],ans[N],sta[N],top;pair<int,int>u[N];
int main(){
	scanf("%d",&n);n<<=1;
	rep(i,1,n)scanf("%d",&a[i]),u[i]=make_pair(a[i],i);
	sort(u+1,u+n+1);
	rep(i,1,n/2)c[u[i].second]=1;
	rep(i,1,n){
		if(!top||c[sta[top]]==c[i])sta[++top]=i;
		else{
			ans[sta[top--]]=0;ans[i]=1;
		}
	}
	rep(i,1,n)if(ans[i])putchar(')');else putchar('(');
	return 0;
}