#include <bits/stdc++.h>
using namespace std;
#define fastio               \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0);
#define int long long
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define endl '\n'
#define pi 3.141592653589793238
#define mp make_pair
#define pb push_back
#define precise cout << fixed << setprecision(20)
#define ff first
#define ss second
#define uniq(v) v.resize(distance(v.begin(), unique(all(v))))
#define lb lower_bound
#define ub upper_bound
#define pii pair<int, int>
#define vi vector<int>
#define vp vector<pair<int, int>>
#define vvi vector<vector<int>>
#define deb(x) cerr << #x << ' ' << '=' << ' ' << x << '\n'
const int mod = 1e9 + 7;
const int INF = 1e9;
const int MAXN = 300005;
template <typename T>
istream &operator>>(istream &in, vector<T> &v)
{
    for (T &x : v)
        in >> x;
    return in;
}
template <typename T>
ostream &operator<<(ostream &out, vector<T> &v)
{
    for (T &x : v)
        out << x << " ";
    return out;
}
int min(int a, int b)
{
    if (a < b)
        return a;
    else
        return b;
}
int max(int a, int b)
{
    if (a > b)
        return a;
    else
        return b;
}
int power(int a, int b)
{
    int res = 1;
    a %= mod;
    assert(b >= 0);
    for (; b; b >>= 1)
    {
        if (b & 1)
            res = res * a % mod;
        a = a * a % mod;
    }
    return res;
}
int gcd(int p, int q)
{
    if (p % q == 0)
        return q;
    else
    {
        return gcd(q, p % q);
    }
}
bool isPrime(int n)
{
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;

    if (n % 2 == 0 || n % 3 == 0)
        return false;

    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;

    return true;
}
int mul(int a, int b) { return ((a % mod) * (b % mod)) % mod; }
int sub(int a, int b) { return (((a - b) % mod) + mod) % mod; }
void primefactorisation(int n)
{
    for (int i = 2; i * i <= n; i++)
    {
        if (n % i == 0)
        {
            int c = 0;
            while (n % i == 0)
            {
                c++;
                n = n / i;
            }
            cout << i << " " << c << endl;
        }
    }
    if (n > 1)
        cout << n << " " << 1 << endl;
}
signed main()
{
    fastio;
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        string s1, s2, s3;
        cin >> s1 >> s2 >> s3;
        for (int i = 1; i <= n; i++)
            cout << 1;
        for (int i = 1; i <= n; i++)
            cout << 0;
        cout << 1;
        cout << endl;
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int MX = 200000;

char s[3][MX + 1], t[MX + 2];

bool check(int n) {
	for (int i = 0; i < 3; i++) {
		int k = 0;
		for (int it = 0; it < 2; it++) {
			for (int j = 0; j < 2 * n; j++) {
				if (s[i][j] == t[k]) k++;
			}
		}
		
		if (k < 2 * n + 1) return false;
	}
	
	return true;
}

int main() {
	int T;
	ignore = scanf("%d", &T);
	while (T--) {
		int n;
		ignore = scanf("%d %s %s %s", &n, s[0], s[1], s[2]);
		
		int len = max((2 * n + 1 - 9) / 2, 0);
		vector<int> lens = {1, 1, 1, len, 1, 1, 1, len, 1, 1, 1};
		for (int mask = 0; mask < (1 << lens.size()); mask++) {
			int i = 0;
			for (size_t j = 0; j < lens.size(); j++) {
				for (int k = 0; k < lens[j]; k++) {
					t[i++] = '0' + ((mask >> j) & 1);
				}
			}
			
			if (check(n)) break;
		}
		
		t[2 * n + 1] = 0;
		printf("%s\n", t);
	}
	
	return 0;
}
