#include <bits/stdc++.h>
using namespace std;
#define range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r)-1; i >= (int)(l); (i) -= 1)
template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) { a = (a > b ? a : b); }
template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) { a = (a < b ? a : b); }
template <typename T1, typename T2> ostream &operator<<(ostream &os,const pair<T1,T2> &p) { os<<p.first<<' '<<p.second; return os;}
template <typename T> ostream &operator<<(ostream &os,const vector<T> &v) { range(i,0,v.size()) {os<<(i?" ":"")<<v[i];} return os;}
using ull = unsigned long long;
using ll = long long;
using PL = pair<ll, ll>;
using P = pair<int, int>;
const ll INF64 = INT64_MAX / 2;
const int INF32 = INT32_MAX / 2;
const char newl = '\n';

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

  int t;
  cin>>t;
  
  while(t--){
    int n;
    cin>>n;
    range(i,0,3){
      string s;
      cin>>s;
    }
    cout<<string(n,'1')+string(n,'0')+"1"<<newl;
  }
}
#include<bits/stdc++.h>
#define pb push_back
using namespace std;
typedef unsigned long long ull;
typedef unsigned uint;
typedef long long ll;
#define G getchar()
int read()
{
	int x=0; bool flg=false; char ch=G;
	for (;!isdigit(ch);ch=G) if (ch=='-') flg=true;
	for (;isdigit(ch);ch=G) x=(x<<3)+(x<<1)+(ch^48);
	return flg?-x:x;
}
#undef G
#define fi first
#define se second
/*
const int mod=;
inline int upd(const int &x){return x+(x>>31&mod);}
inline void add(int &x,const int &y){x=upd(x+y-mod);}
inline void iadd(int &x,const int &y){x=upd(x-y);}
int qpow(int x,int y){
	int res=1;
	for (;y;y>>=1,x=1LL*x*x%mod)
		if (y&1) res=1LL*res*x%mod;
	return res;
}
*/
//typedef pair<int,int> P;
#define rep(i,l,r) for (int i(l);i<=int(r);i++)
#define per(i,l,r) for (int i(r);i>=int(l);i--)
#define all(x) (x).begin(),(x).end()

int n;
char s[200010],t[200010],r[200010];
void solve(){
	scanf("%d%s%s%s",&n,s+1,t+1,r+1);
	n<<=1; int m=n>>1;
	static bool b[2][2];
	memset(b,0,sizeof b);
	b[s[1]^48][s[n]^48]=1;
	b[t[1]^48][t[n]^48]=1;
	b[r[1]^48][r[n]^48]=1;
	if (b[0][0]&&b[1][1]){
		if (b[1][0]){
			putchar(49);
			rep(T,1,m) putchar(48);
			rep(T,1,m) putchar(49);
			puts("");
		}
		else{
			rep(T,1,m) putchar(49);
			rep(T,1,m) putchar(48);
			putchar(49);
			puts("");
		}
	}
	else if (b[1][1]){
		rep(T,1,m) putchar(48);
		putchar(49);
		rep(T,1,m) putchar(48);
		puts("");
	}
	else{
		rep(T,1,m) putchar(49);
		putchar(48);
		rep(T,1,m) putchar(49);
		puts("");
	}
}
int main()
{
	for (int T=read();T--;) solve();
	return 0;
}