#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back

void solve(){
	int n;
	string a,b,c;
	cin>>n;
	cin>>a>>b>>c;
	for(int i=1;i<=n;i++) cout<<0;
	for(int i=1;i<=n;i++) cout<<1;	
	cout<<0<<"\n";
}

int main(){
	
	int t=1;
	cin>>t;
	
	for(int tc=1; tc<=t; tc++){
		solve();
	}
	
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll; //int:2*10**9
typedef long double ld;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i = 0; i<(ll)(n); i++)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define pb push_back
#define MOD 1000000007 //998244353
#define PI 3.141592653
#define INF 100000000000000 //14
//cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);

ll cat(string s) {
    if (s[0]=='0' && s[s.length()-1]=='0') return 0;
    if (s[0]=='0' && s[s.length()-1]=='1') return 1;
    if (s[0]=='1' && s[s.length()-1]=='0') return 2;
    else return 3;
}

void solve() {
    ll n; string a, b, c; cin >> n >> a >> b >> c;
    if (cat(a)!=3 && cat(b)!=3 && cat(c)!=3) {
        string ans = "";
        REP(i,n) ans+='1';
        ans+='0';
        REP(i,n) ans+='1';
        cout << ans << endl;
        return;
    }
    if (cat(a)!=0 && cat(b)!=0 && cat(c)!=0) {
        string ans = "";
        REP(i,n) ans+='0';
        ans+='1';
        REP(i,n) ans+='0';
        cout << ans << endl;
        return;
    }
    else {
        string ans ="";
        REP(i,n) ans+='0';
        REP(i,n) ans+='1';
        ans+='0';
        cout << ans << endl;
        return;
    }
}
int main(){
    ll t; cin >> t;
    REP(i,t) solve();
    return 0;
}  