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

typedef long long LL;

const int N=200000;

int n,a[N*2+9],ord[N*2+9];

void into(){
  scanf("%d",&n);
  for (int i=1;i<=n<<1;++i){
	scanf("%d",&a[i]);
	ord[i]=i;
  }
}

stack<int>sta;
char ans[N*2+9];

void Get_ans(){
  sort(ord+1,ord+n*2+1,[&](const int &x,const int &y){return a[x]<a[y];});
  for (int i=1;i<=n;++i) a[ord[i]]=0;
  for (int i=n+1;i<=n<<1;++i) a[ord[i]]=1;
  for (int i=1;i<=n<<1;++i)
	if (sta.empty()||a[i]==a[sta.top()]) sta.push(i);
    else{
	  ans[sta.top()]='(';
	  ans[i]=')';
	  sta.pop();
	}
}

void work(){
  Get_ans();
}

void outo(){
  for (int i=1;i<=n<<1;++i)
	putchar(ans[i]);
  puts("");
}

int main(){
  int T=1;
  //scanf("%d",&T);
  for (;T--;){
	into();
	work();
	outo();
  }
  return 0;
}
#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) begin(x), end(x)
using namespace std;
using ll = long long;
constexpr ll Mod = 998244353;
constexpr ll mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;
const double PI = acos(-1);
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {
    return a < b && (a = b, true);
}
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
    return a > b && (a = b, true);
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
    for(T &x : v) is >> x;
    return is;
}
struct IoSetup {
    IoSetup() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
        cerr << fixed << setprecision(10);
    }
} iosetup;
/*-------------------------------------------*/

int main() {
    int n;
    cin >> n;
    vector<int> a(n * 2);
    cin >> a;

    vector<int> p(n * 2);
    iota(ALL(p), 0);
    sort(ALL(p), [&](int i, int j) { return a[i] < a[j]; });

    rep(i, n * 2) a[p[i]] = (i < n);

    stack<int> st;
    string ans(n * 2, '.');

    rep(i, n * 2) {
        if(st.empty() || a[st.top()] == a[i])
            st.push(i);
        else {
            ans[st.top()] = '(';
            ans[i] = ')';
            st.pop();
        }
    }

    cout << ans << endl;
}