#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pi pair<int,int>
#define f first
#define s second
void find(int N,vector<int>& a)
{
    int n=(N<<1);
    vector<bool> vis(n,1);
    vector<pi> val(n);
    for(int i=0;i<n;i++)
    val[i]=make_pair(a[i],i);
    sort(val.begin(),val.end());
    for(int i=0;i<N;i++)
    vis[val[i].s]=0;
    int cur=0;
    string res="";
    bool f=0;
    for(int i=0;i<n;i++)
    {
        if(cur==0 or vis[i]==f)
        {
            res.push_back('(');
            f=vis[i];
            ++cur;
        }
        else
        {
            res.push_back(')');
            --cur;
        }
    }
    cout<<res;
}
int32_t main()
{
    int n;
    cin>>n;
    vector<int> a(2*n);
    for(int i=0;i<2*n;i++)
    cin>>a[i];
    find(n,a);
    return 0;
}

#pragma GCC optimize("Ofast")
#if 1
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using ll = int64_t;
using db = double;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vpii = vector<pii>;
using vpll = vector<pll>;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define show(x) cerr << #x << " = " << (x) << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define sz(x) (int)(x).size()
#define YesNo(x) cout<<((x)?"Yes":"No")<<newl;
#define YESNO(x) cout<<((x)?"YES":"NO")<<newl;
#define v(T) vector<T>
#define vv(T) vector<vector<T>>

template<class A, class B> using umap = unordered_map<A, B>;
template<class A> using uset = unordered_set<A>;

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> bool lcmp(const pair<T, T>& l, const pair<T, T>& r) {
  return l.first < r.first;
}
template<class T> istream& operator>>(istream& i, v(T)& v) {
  F0R(j, sz(v)) i >> v[j];
  return i;
}
template<class A, class B> istream& operator>>(istream& i, pair<A, B>& p) {
  return i >> p.first >> p.second;
}
template<class A, class B, class C> istream& operator>>(istream& i, tuple<A, B, C>& t) {
  return i >> get<0>(t) >> get<1>(t) >> get<2>(t);
}
template<class T> ostream& operator<<(ostream& o, const pair<T, T>& v) {
  o << "(" << v.first << "," << v.second << ")";
  return o;
}
template<class T> ostream& operator<<(ostream& o, const vector<T>& v) {
  F0R(i, v.size()) {
    o << v[i] << ' ';
  }
  o << newl;
  return o;
}
template<class T> ostream& operator<<(ostream& o, const set<T>& v) {
  for (auto e : v) {
    o << e << ' ';
  }
  o << newl;
  return o;
}
template<class T1, class T2> ostream& operator<<(ostream& o, const map<T1, T2>& m) {
  for (auto& p : m) {
    o << p.first << ": " << p.second << newl;
  }
  o << newl;
  return o;
}

/*
Aを数の大きさ順で上半分、下半分のグループにわけ
カッコで対応するペアは別グループと組むようにする
*/

// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int N; cin >> N;
  vpii as(2*N);
  F0R(i, 2*N) {
    cin >> as[i].first;
    as[i].second = i;
  }
  sort(rng(as));
  v(bool) bs(2*N);
  F0R(i, 2 * N) {
    bs[as[i].second] = i < N;
  }
  v(bool) st; // ( のグループ
  F0R(i, 2 * N) {
    if (st.empty() || st.back() == bs[i]) {
      cout << '(';
      st.push_back(bs[i]);
    }
    else {
      cout << ')';
      st.pop_back();
    }
  }
  cout << newl;
}
#endif
