#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int score(int N, vector<int> A, string S) {
	vector<int> st;
	int ans = 0;
	for (int i = 0; i < 2 * N; ++i) {
		if (S[i] == '(') st.push_back(i);
		else {
			ans += abs(A[st.back()] - A[i]);
			st.pop_back();
		}
	}
	return ans;
}
string solve(int N, vector<int> A) {
	vector<int> p(2 * N);
	for (int i = 0; i < 2 * N; ++i) {
		p[i] = i;
	}
	sort(p.begin(), p.end(), [&](int va, int vb) { return A[va] < A[vb]; });
	vector<int> ip(2 * N);
	for (int i = 0; i < 2 * N; ++i) {
		ip[p[i]] = i;
	}
	vector<int> sa, sb;
	string str(2 * N, '?');
	for (int i = 0; i < 2 * N; ++i) {
		if (ip[i] < N) {
			sa.push_back(i);
		}
		else {
			sb.push_back(i);
		}
		if (sa.size() >= 1 && sb.size() >= 1) {
			int ta = sa.back(); sa.pop_back();
			int tb = sb.back(); sb.pop_back();
			if (ta > tb) swap(ta, tb);
			str[ta] = '(';
			str[tb] = ')';
		}
	}
	return str;
}
string solve_easy(int N, vector<int> A) {
	string perm = string(N, '(') + string(N, ')');
	int opt = -1; string ans;
	do {
		int d = 0; bool ok = true;
		for (int i = 0; i < 2 * N; ++i) {
			if (perm[i] == '(') ++d;
			else --d;
			if (d < 0) {
				ok = false;
				break;
			}
		}
		if (ok) {
			int res = score(N, A, perm);
			if (res > opt) {
				opt = res;
				ans = perm;
			}
		}
	} while (next_permutation(perm.begin(), perm.end()));
	return ans;
}
#include <random>
mt19937_64 mt(2105272032);
int rand_int(int l, int r) {
	uniform_int_distribution<int> p(l, r - 1);
	return p(mt);
}
string to_string(vector<int> arr) {
	string res = "[";
	for (int i = 0; i < arr.size(); ++i) {
		if (i) res += ", ";
		res += to_string(arr[i]);
	}
	res += "]";
	return res;
}
void random_check() {
	for (int N = 1; N <= 7; ++N) {
		for (int testcase = 1; testcase <= 10000; ++testcase) {
			vector<int> A(2 * N);
			for (int i = 0; i < 2 * N; ++i) {
				A[i] = rand_int(1, 10);
			}
			string res1 = solve(N, A);
			string res2 = solve_easy(N, A);
			if (score(N, A, res1) != score(N, A, res2)) {
				cout << "N = " << N << " / Case #" << testcase << ":" << endl;
				cout << "A = " << to_string(A) << endl;
				cout << "Returns: " << res1 << endl;
				cout << "Answer: " << res2 << endl;
				cout << endl;
			}
		}
		cout << "N = " << N << " Completed!" << endl;
		cout << endl;
	}
}
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	int N;
	cin >> N;
	vector<int> A(2 * N);
	for (int i = 0; i < 2 * N; ++i) {
		cin >> A[i];
	}
	cout << solve(N, A) << endl;
	return 0;
}
#include <bits/stdc++.h>
using namespace std;

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

	int n;
	cin >> n;

	vector<int> a(2 * n);
	for (auto &x : a) cin >> x;

	vector<int> ind(2 * n);
	iota(ind.begin(), ind.end(), 0);
	sort(ind.begin(), ind.end(), [&](int i, int j) {
		return a[i] < a[j];
	});

	vector<bool> big(2 * n);
	for (int i = n; i < 2 * n; i++) {
		big[ind[i]] = true;
	}

	string ans(2 * n, 0);
	vector<int> st;

	for (int i = 0; i < 2 * n; i++) {
		if (!st.empty() && (big[st.back()] ^ big[i])) {
			ans[i] = ')';
			st.pop_back();
		} else {
			ans[i] = '(';
			st.push_back(i);
		}
	}
	cout << ans << '\n';
	return 0;
}