#include "bits/stdc++.h"
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endl '\n'
#define all(V) (V).begin(), (V).end() 
using namespace std;
typedef long long ll;

int main() {fio;
	int n;
	cin >> n;
	vector <pair <int, int>> a(2 * n);
	vector <pair <int, int>> b(2 * n);
	string s;
	for(int i = 0; i < 2 * n; i++) {
		cin >> a[i].first;
		a[i].second = i;
		b[i] = a[i];
	}
	sort(all(b));
	vector <bool> oh(2 * n);
	for(int i = 0; i < 2 * n; i++) {
		if(a[i] < b[n]) {
			oh[i] = 0;
		} else {
			oh[i] = 1;
		}
	}
	int ls = 0;
	for(int i = 0; i < 2 * n; i++) {
		if(oh[i]) {
			if(ls >= 0) {
				s += '(';
			} else {
				s += ')';
			}
			ls++;
		} else {
			if(ls <= 0) {
				s += '('; 
			} else {
				s += ')';
			}
			ls--;
		}
	}
	assert(ls == 0);
	cout << s << endl;
    return 0;
}
#include<bits/stdc++.h>
#include<bits/extc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
template<typename TH> void _dbg(const char* sdbg, TH h) { cerr<<sdbg<<"="<<h<<"\n"; }
template<typename TH, typename... TA> void _dbg(const char* sdbg, TH h, TA... t){
	while(*sdbg != ',') { cerr<<*sdbg++; } cerr<<"="<<h<<","; _dbg(sdbg+1, t...);
}
#ifdef DEBUG
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr<<#x<<": "; for(auto i:x) cerr<<i<<" "; cerr<<endl;}}
#define debugr(l,r,x) {{cerr<<#x<<": "; for(int i=l;i<=r;i++) cerr<<x<<" "; cerr<<endl;}}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define debugr(l,r,x)
#define cerr while(0) cerr
#endif
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//#define int long long
typedef __int128 INT;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define priority_queue std::priority_queue
#define F first
#define S second
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

int a[500005];
bool good[500005];
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	string ans="";
	int n;
	cin>>n;
	n*=2;
	for(int i=0; i<n; i++) ans.push_back('#');
	for(int i=0; i<n; i++){
		cin>>a[i];
	}
	vi idx(n);
	iota(idx.begin(), idx.end(), 0);
	sort(idx.begin(), idx.end(), [&](int x, int y){
		return a[x] < a[y];
	});
	for(int i=0; i<n/2; i++){
		good[idx[i]]=1;
	}
	stack<int> st;
	for(int i=0; i<n; i++){
		if(st.empty()){
			ans[i]='(';
			st.push(i);
		}
		else{
			int t=st.top();
			if(good[t]==good[i]){
				st.push(i);
			}
			else{
				st.pop();
				ans[t]='(';
				ans[i]=')';
			}
		}
	}
	cout<<ans<<endl;
}