#include <bits/stdc++.h>

#define _overload(_1, _2, _3, _4, name, ...) name
#define _rep1(Itr, N) _rep3(Itr, 0, N, 1)
#define _rep2(Itr, a, b) _rep3(Itr, a, b, 1)
#define _rep3(Itr, a, b, step) for (i64(Itr) = a; (Itr) < b; (Itr) += step)
#define repeat(...) _overload(__VA_ARGS__, _rep3, _rep2, _rep1)(__VA_ARGS__)
#define rep(...) repeat(__VA_ARGS__)

using namespace std;
using i64 = long long;
using u64 = unsigned long long;

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

    i64 t;
    cin >> t;

    auto f = [](string &s, string &t) {
        int i = 0;
        int j = 0;

        while (j < t.size()) {
            while (i < s.size() && s[i] != t[j]) {
                i++;
            }
            j++;
        }

        return i < s.size();
    };

    repeat(_, t) {
        i64 n;
        cin >> n;
        string s[3];
        cin >> s[0] >> s[1] >> s[2];

        string cmp[4];

        {
            cmp[0].reserve(2 * n + 1);
            repeat(i, n) cmp[0].push_back('0');
            repeat(i, n) cmp[0].push_back('1');
            cmp[0].push_back('0');
        }
        {
            cmp[1].reserve(2 * n + 1);
            repeat(i, n) cmp[1].push_back('0');
            repeat(i, n) cmp[1].push_back('1');
            cmp[1].push_back('1');
        }
        {
            cmp[2].reserve(2 * n + 1);
            repeat(i, n) cmp[2].push_back('1');
            repeat(i, n) cmp[2].push_back('0');
            cmp[2].push_back('0');
        }
        {
            cmp[3].reserve(2 * n + 1);
            repeat(i, n) cmp[3].push_back('1');
            repeat(i, n) cmp[3].push_back('0');
            cmp[3].push_back('1');
        }

        repeat(i, 3) s[i] += s[i];

        bool out = false;
        repeat(i, 4) {
            if (f(s[0], cmp[i]) && f(s[1], cmp[i]) && f(s[2], cmp[i])) {
                cout << cmp[i] << '\n';
                out = true;
                break;
            }
        }

        assert(out);
    }

    return 0;
}
#include<bits/stdc++.h>
using namespace std;
int read()
{
	int s=0,w=1;
	char ch=getchar();
	while(ch<'0'||ch>'9') {if(ch=='-') w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48),ch=getchar();
	return s*w;
}
string s1,s2,s3;
int mp[400010],n;
signed main()
{
	int T=read(),dfx=0;
	while(T--)
	{
		n=read();
		cin>>s1>>s2>>s3;
		cout<<0;
		for(int i=1;i<=n;i++) cout<<1;
		for(int i=1;i<=n;i++) cout<<0;
		cout<<'\n';
	}
	return 0;
}