#include <bits/stdc++.h>

const int N = 200010;

int T, n;
char a[N], b[N], c[N];

void solve() {
	scanf("%d", &n);
	scanf("%s%s%s", a + 1, b + 1, c + 1);
	int t = (a[2 * n] - '0') + (b[2 * n] - '0') + (c[2 * n] - '0');
	if (t == 0 || t == 3) {
		if (!t) {
			for (int i = 1; i <= 2 * n; i ++) std::cout << '1';
			std::cout << "0\n";
		}
		else {
			for (int i = 1; i <= 2 * n; i ++) std::cout << '0';
			std::cout << "1\n";
		}
	} 
	else if (t == 1) {
		for (int i = 1; i <= n; i ++) std::cout << '0';
		for (int i = 1; i <= n; i ++) std::cout << '1';
		std::cout << "0\n";
	}
	else {
		for (int i = 1; i <= n; i ++) std::cout << '1';
		for (int i = 1; i <= n; i ++) std::cout << '0';
		std::cout << "1\n";
	}
}
int main() {
	scanf("%d", &T);
	while (T --) solve();
	return 0; 
} 
#include <bits/stdc++.h>

using namespace std;

//#define ONLINE_JUDGE
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define rep(z, x, y) for(int z=x;z<=y;++z)
#define repe(z, x, y) for(int z=x;z<y;++z)
#define repd(z, x, y) for(int z=x;z>=y;--z)
#define repde(z, x, y) for(int z=x;z>y;--z)
#define int long long

typedef long long ll;
typedef pair<int, int> PII;

const int INF = 0x3f3f3f3f;
const double eps = 1e-9;
const int mod = 1e9 + 7;



void solve()
{
    int n, x;
    cin >> n >> x;
    rep(i, 1, n)
    {
        int tmp;
        cin >> tmp;
        if(tmp != x)
            cout << tmp << ' ';
    }

    cout << endl;
}

signed main()
{
    #ifndef ONLINE_JUDGE
        freopen("IO/in.txt", "r", stdin);
        freopen("IO/out.txt", "w", stdout);
    #endif

    IOS;
    int t;
    solve();
}