#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int sz = 8e5+5;

int a[sz];
pair <int,int> b[sz];
bool cut[sz];

int main() {
   int n;
   cin >> n;
   n <<= 1;
   for(int i=0; i<n; i++) scanf("%d", &a[i]), b[i] = {a[i], i};
   sort(b, b+n);
   for(int i=0; i<n/2; i++) cut[b[i].second] = 1;

   for(int i=0, z=0, f=0; i<n; i++) {
      if(cut[i]) {
         if(f and z) printf(")"), z--;
         else printf("("), z++, f = 0;
      }
      else {
         if(!f and z) printf(")"), z--;
         else printf("("), z++, f = 1;
      }
   }
}

#include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()

using ll=long long;
typedef pair<int,int> P;

signed main(){
  int n;cin>>n;
  vector<int> v(2*n);
  REP(i,2*n)cin>>v[i];
  vector<P> w(2*n);
  REP(i,2*n)w[i]=P(v[i],i);
  sort(ALL(w));
  vector<int> a(2*n);
  REP(i,n)a[w[i].second]=1;
  REP(i,n)a[w[i+n].second]=-1;
  ll now=0;
  string ans;
  REP(i,2*n){
    if(abs(now)>abs(now+a[i]))ans.push_back(')');
    else ans.push_back('(');
    now+=a[i];
  }
  cout<<ans<<endl;
}
