#pragma GCC optimize ("O2")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<iostream>
#include<cstring>
//#include<atcoder/all>
//using namespace atcoder;

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

char cn[1200010];
char* ci = cn, * di = cn, ct;
//char tc[200002], *d1 = tc + 100000, *d2 = tc + 200000;
const char d[2] = "0";

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

	fread(cn, 1, 1200010, stdin);
	int T = 0;
	while ((ct = *ci++) >= '0') T = T * 10 + ct - '0';

	rep(t, T) {
		int N = 0;
		while ((ct = *ci++) >= '0') N = N * 10 + ct - '0';

		memset(di, '0', N);
		di += N;
		memset(di, '1', N);
		di += N;
		*di++ = '0';
		*di++ = '\n';
		ci += 6 * N + 3;
	}
	fwrite(cn, 1, di - cn, stdout);

	Would you please return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <iostream>
#include <fstream>
#include <chrono>

using namespace std;

void solve(int test, istream &in) {
    int n;
    string s[3];
    in >> n >> s[0] >> s[1] >> s[2];
    bool has[2] = { false, false };
    for (int k = 0; k < 3; k++) {
        has[s[k][0] - '0'] = true;
    }
    char start = 0;
    if (!has[start])
        start = 1;
    string answer(2 * n + 1, '0');
    answer[0] = '0' + start;
    for (int i = 0; i < n; i++) {
        answer[1 + i] = '1' - start;
        answer[1 + n + i] = '0' + start;
    }
    printf("%s\n", answer.c_str());
}

int main(int argc, char* argv[])
{
#ifdef VLAD_LOCAL
	//FILE *f = fopen("in.txt", "r");
    ifstream f("in.txt");
    auto start = std::chrono::steady_clock::now();
#else
	//FILE *f = stdin;
    istream &f = cin;
#endif
    int tests = 1;
    f >> tests;
    for (int test = 0; test < tests; test++) {
        solve(test, f);
    }
#ifdef VLAD_LOCAL
    auto end = std::chrono::steady_clock::now();
    double seconds = (double)std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() / 1000;
    printf("%.3lf seconds\n", seconds);
#endif
	return 0;
}

