#include<bits/stdc++.h>
using namespace std;
const int N=4e5+5; 
int n,f[N],stk[N],top;
struct pt {
	int val,i;
}a[N];
bool cmp(pt p,pt q) {return p.val<q.val;}
int main() {
	scanf("%d",&n);
	for(int i=1;i<=2*n;++i)scanf("%d",&a[i].val),a[i].i=i;
	sort(a+1,a+2*n+1,cmp);
	for(int i=2*n;i>n;--i)f[a[i].i]=1;
	for(int i=1;i<=2*n;++i) {
		if(!top||f[stk[top]]==f[i]) {
			printf("(");
			stk[++top]=i;
		}
		else --top,printf(")");
	}
	return 0;
}
#include <iostream>
using namespace std;

int main() {
	int T;
	cin >> T;
	for (int t = 0; t < T; t++) {
		int N;
		cin >> N;
		string S1, S2, S3;
		cin >> S1 >> S2 >> S3;
		cout << 1;
		for (int i = 0; i < N; i++) cout << 0;
		for (int i = 0; i < N; i++) cout << 1;
		cout << endl;
	}
}