#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll> pql;
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef map<ll, ll> ml;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, k, n) for(ll i = ll(k); i <= ll(n); i++)
#define rep3(i, n, k) for(ll i = ll(n); i >= ll(k); i--)
#define all(v) (v).begin(), (v).end()
ll mod(ll a, ll b) {return (a % b + b) % b;}
ll quo(ll a, ll b) {return (a - mod(a, b)) / b;}
template <typename T, typename U> bool chmin(T &a, const U b) {if(a > b) {a = b; return 1;} return 0;}
template <typename T, typename U> bool chmax(T &a, const U b) {if(a < b) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 2e5;
const ld eps = 1e-9;
const char newl = '\n';

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  ll n;
  string ans;
  cin >> n;
  vl a(2*n);
  rep(i, 2*n) cin >> a[i];
  vpl vec(2*n);
  rep(i, 2*n) vec[i] = pl(a[i], i);
  sort(all(vec));
  vb plus(2*n, 1);
  rep(i, n) plus[vec[i].second] = 0;
  ll cnt = 0;
  rep(i, 2*n) {
    if(plus[i]) {
      if(cnt >= 0) ans += '(';
      else ans += ')';
      cnt++;
    }else {
      if(cnt <= 0) ans += '(';
      else ans += ')';
      cnt--;
    }
  }
  cout << ans << newl;
  return 0;
}
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef pair<ld,ld> state;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

int co[666666];
char f[556555];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n; cin>>n; n*=2;
	vector<ii> vec;
	for(int i=0;i<n;i++)
	{
		int x; cin>>x; vec.pb({x,i});
	}
	sort(vec.begin(),vec.end());
	for(int i=0;i<n;i++)
	{
		if(i<n/2) co[vec[i].se]=1;
		else co[vec[i].se]=0;
	}
	stack<int> S;
	
	for(int i=0;i<n;i++)
	{
		if((!S.empty())&&(co[S.top()]!=co[i]))
		{
			f[S.top()]='(';
			S.pop();
			f[i]=')';
		}
		else S.push(i);
	}
	for(int i=0;i<n;i++)
	{
		cout<<f[i];
	}
	cout<<'\n';
}
