#include<iostream>
#include<string>
using namespace std;
int main() {
  int T,N;
  cin >> T;
  string s1,s2,s3;
  int i,j;
  for(i=0;i<T;i++) {
    cin >> N >> s1 >> s2 >> s3;
    if(min(s1[0],s1[2*N-1]) == '0' && min(s2[0],s2[2*N-1]) == '0' && min(s3[0],s3[2*N-1]) == '0') {
      for(j=0;j<N;j++)cout << "1";
      cout << "0";
      for(j=0;j<N;j++)cout << "1";
      cout << endl;
    }
    else if(max(s1[0],s1[2*N-1]) == '1' && max(s2[0],s2[2*N-1]) == '1' && max(s3[0],s3[2*N-1]) == '1') {
      for(j=0;j<N;j++)cout << "0";
      cout << "1";
      for(j=0;j<N;j++)cout << "0";
      cout << endl;
    }
    else if(s1[0]+s2[0]+s3[0]-3*'0' > 1) {
      cout << "1";
      for(j=0;j<N;j++)cout << "0";
      for(j=0;j<N;j++)cout << "1";
      cout << endl;
    }
    else {
      cout << "0";
      for(j=0;j<N;j++)cout << "1";
      for(j=0;j<N;j++)cout << "0";
      cout << endl;
    }
  }
}
//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <functional>
#include <cstring>
#include <string>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <complex>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define itn int
#define nit int
#define ll long long
#define ms multiset
#define F(i,a,b) for(register int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(register int i=a,i##end=b;i>=i##end;--i)
#define re register
#define ri re int
#define il inline
#define pii pair<int,int>
#define cp complex<double>
//#pra gma G CC opti mize(3)
using namespace std;
using std::bitset;
//using namespace __gnu_pbds;
const double Pi=acos(-1);
namespace fastIO {
	template<class T>
	inline void read(T &x) {
		x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		if(fu)x=-x;
	}
	inline int read() {
		int x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		return fu?-x:x;
	}
	char _n_u_m_[40];
	template<class T>
	inline void write(T x ) {
		if(x==0) {
			putchar('0');
			return;
		}
		T tmp = x > 0 ? x : -x ;
		if( x < 0 ) putchar('-') ;
		register int cnt = 0 ;
		while( tmp > 0 ) {
			_n_u_m_[ cnt ++ ] = tmp % 10 + '0' ;
			tmp /= 10 ;
		}
		while( cnt > 0 ) putchar(_n_u_m_[ -- cnt ]) ;
	}
	template<class T>
	inline void write(T x ,char ch) {
		write(x);
		putchar(ch);
	}
}
using namespace fastIO;
string s[4];
int p0[4][200002],p1[4][200002];
int n,t1,t2;
char inv[10002];
int main() {
	inv['0']='1';
	inv['1']='0';
	F(qwqwq,1,read()) {
		cin>>n;
		cin>>s[1]>>s[2]>>s[3];
		F(i,1,n)putchar('0');F(i,1,n)putchar('1');puts("0");continue;
		F(i,1,3)s[i].insert(0,"F");
		F(i,1,3) {
			t1=t2=0;
			F(j,1,n+n) {
				if(s[i][j]=='0')p0[i][++t1]=j;
				else p1[i][++t2]=j;
			}
		}
		F(i,1,n) {
			if(p0[1][i]-p0[1][i-1]>1&&p0[2][i]-p0[2][i-1]>1&&p0[3][i]-p0[3][i-1]>1) {
				F(ii,1,n)putchar('1');
				F(ii,2,i)putchar('0');
				putchar('1');
				F(ii,i,n)putchar('0');
				goto ak;
			}
		}
		F(i,1,n) {
			if(p1[1][i]-p1[1][i-1]>1&&p1[2][i]-p1[2][i-1]>1&&p1[3][i]-p1[3][i-1]>1) {
				F(ii,1,n)putchar('0');
				F(ii,2,i)putchar('1');
				putchar('0');
				F(ii,i,n)putchar('1');
				goto ak;
			}
		}

		F(i,1,3)s[i]+=s[i];
		F(i,1,3)p0[i][n+n+1]=p1[i][n+n+1]=4*n+1;
		F(i,1,3) {
			t1=t2=n;
			F(j,1,n+n) {
				if(s[i][j]=='0')p0[i][++t1]=j+n+n;
				else p1[i][++t2]=j+n+n;
			}
		}
		F(i,1,n+n+1) {
			if(p0[1][i]-p0[1][i-1]>1&&p0[2][i]-p0[2][i-1]>1&&p0[3][i]-p0[3][i-1]>1) {
				F(ii,2,i)putchar('0');
				putchar('1');
				F(ii,i,n+n)putchar('0');
				goto ak;
			}
		}
		F(i,1,n+n+1) {
			if(p1[1][i]-p1[1][i-1]>1&&p1[2][i]-p1[2][i-1]>1&&p1[3][i]-p1[3][i-1]>1) {
				F(ii,2,i)putchar('1');
				putchar('0');
				F(ii,i,n+n)putchar('1');
				goto ak;
			}
		}
		if((p0[1][n]!=n+n||p1[1][1]==1)&&(p0[2][n]!=n+n||p1[2][1]==1)&&(p0[3][n]!=n+n||p1[3][1]==1)) {
			F(ii,1,n)putchar('0');
			putchar('1');
			F(ii,1,n)putchar('0');
			goto ak;
		}
		if((p1[1][n]!=n+n||p0[1][1]==1)&&(p1[2][n]!=n+n||p0[2][1]==1)&&(p1[3][n]!=n+n||p0[3][1]==1)) {
			F(ii,1,n)putchar('1');
			putchar('0');
			F(ii,1,n)putchar('1');
			goto ak;
		}
		
		

ak:
		;
		putchar('\n');
	}
	return 0;
}
