/**

   * Made by:    Diego Briaares
   * At:   07.03.2021 18:28:23
**/

#include <bits/stdc++.h>
using namespace std;


void optimize() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
}

void test_case() {
	int n;
	cin >> n;
	string s1, s2, s3;
	cin >> s1 >> s2 >> s3;
	s1 += s1;
	s2 += s2;
	s3 += s3;
	vector<string> cand;
	string a, b;
	for (int i = 0; i < n; i++) a.push_back('0');
	for (int i = 0; i < n; i++) b.push_back('1');
	string c = a + b + "0";
	cout << c << "\n";
}

	int main () {
		optimize();
		int t;
		cin >> t;
		while (t--) {
			test_case();

		}
	}
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
const int N = 1e6 + 5;
using namespace std;

int cas, n;
char s[3][N], T[N];

template < typename T >
inline T read()
{
	 T x = 0, w = 1; char c = getchar();
	 while(c < '0' || c > '9') { if(c == '-') w = -1; c = getchar(); }
	 while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	 return x * w; 
}

bool check()
{
	 bool flag = 1; int pos = 1;
	 for(int op = 0; op < 3; op++)
	 {
		  pos = 1;
		  for(int i = 1; i <= 4 * n; i++)
				if(pos <= 2 * n + 1 && T[pos] == s[op][i > 2 * n ? i - 2 * n : i]) pos++;
		  flag &= pos > 2 * n;
	 }
	 return flag;
}

int main()
{
#ifndef ONLINE_JUDGE
	 freopen("cpp.in", "r", stdin);
#endif
	 cas = read <int> ();
	 while(cas--)
	 {
		  n = read <int> (), scanf("%s", s[0] + 1), scanf("%s", s[1] + 1), scanf("%s", s[2] + 1);
		  for(int i = 1; i <= n; i++) T[i] = '1', T[n + i] = '0'; T[2 * n + 1] = '1';
		  if(check()) { for(int i = 1; i <= 2 * n + 1; i++) printf("%c", T[i]); puts(""); continue; }
		  for(int i = 1; i <= n; i++) T[i] = '1', T[n + i] = '0'; T[2 * n + 1] = '0';
		  if(check()) { for(int i = 1; i <= 2 * n + 1; i++) printf("%c", T[i]); puts(""); continue; }
		  for(int i = 1; i <= n; i++) T[i] = '0', T[n + i] = '1'; T[2 * n + 1] = '0';
		  if(check()) { for(int i = 1; i <= 2 * n + 1; i++) printf("%c", T[i]); puts(""); continue; }
		  for(int i = 1; i <= n; i++) T[i] = '0', T[n + i] = 1; T[2 * n + 1] = '1';
		  if(check()) { for(int i = 1; i <= 2 * n + 1; i++) printf("%c", T[i]); puts(""); continue; }
		  T[1] = '0'; for(int i = 1; i <= n; i++) T[i + 1] = '1', T[n + i + 1] = '0';
		  if(check()) { for(int i = 1; i <= 2 * n + 1; i++) printf("%c", T[i]); puts(""); continue; }
		  T[1] = '1'; for(int i = 1; i <= n; i++) T[i + 1] = '1', T[n + i + 1] = '0';
		  if(check()) { for(int i = 1; i <= 2 * n + 1; i++) printf("%c", T[i]); puts(""); continue; }		  
		  T[1] = '1'; for(int i = 1; i <= n; i++) T[i + 1] = '0', T[n + i + 1] = '1';
		  if(check()) { for(int i = 1; i <= 2 * n + 1; i++) printf("%c", T[i]); puts(""); continue; }
		  T[1] = '0'; for(int i = 1; i <= n; i++) T[i + 1] = '0', T[n + i + 1] = '1';
		  if(check()) { for(int i = 1; i <= 2 * n + 1; i++) printf("%c", T[i]); puts(""); continue; }
	 }
	 return 0; 
}
