#include<bits/stdc++.h>

using namespace std;

string a, b, c;
bool can(string s){
    int good = 1;
    for(auto x: {a, b, c}){
        x += x;
        int now = 0;
        for(int i = 0; i < (int)x.size(); i ++){
            if(x[i] == s[now]) now ++;
        }
        good &= (now >= (int)s.size());
    }
    return good;
}
int main(){
	ios_base::sync_with_stdio(false);
    
    int t;
    cin >> t;
    while(t --){
        int n;
        cin >> n;
        cin >> a >> b >> c;
        string s1 = string(n, '0') + string(n, '1');
        string s2 = string(n, '1') + string(n, '0');
        if(can(s1 + '0')){
            cout << s1 + '0' << "\n";
        }else if(can(s1 + '1')){
            cout << s1 + '1' << "\n";
        }else if(can(s2 + '0')){
            cout << s2 + '0' << "\n";
        }else if(can(s2 + '1')){
            cout << s2 + '1' << "\n";
        }else{
            assert(0);
        }
    }
}

#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define eb emplace_back
#define unused [[maybe_unused]]
#define tempT template<class T>
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define debug(x) cerr << #x << ": " << x << endl
#define ans_exit(x) { cout << x << endl; exit(0); }
#define ans_return(x) { cout << x << endl; return; }
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define r_rep(i, n) for (int i = (int)(n) - 1; i >= 0; i--)
#define reps(i, n, m) for (ll i = (ll)(n); i < (ll)(m); i++)
#define r_reps(i, n, m) for (ll i = (ll)(m) - 1; i >= (ll)(n); i--)
#define debugarr(a) {cerr << #a << ":"; \
                    for(auto _e:a){cerr << " " <<_e;} cerr << endl;}

using ll   unused = long long;
using ld   unused = long double;
using vl   unused = vector<ll>;
using vvl  unused = vector<vl>;
using vvvl unused = vector<vvl>;
using lp   unused = pair<ll, ll>;
using lmap unused = map<int, int>;

unused constexpr ll MOD = 1e9 + 7;
unused constexpr ll INF = 1 << 29;
unused constexpr ll LINF = 1LL << 61;
unused constexpr int DX[8] = {0, 1, 0,-1, 1, 1,-1,-1};
unused constexpr int DY[8] = {1, 0,-1, 0, 1,-1, 1,-1};
unused inline bool bit(ll b, ll i) { return b & (1LL << i); }
unused inline ll ceiv(ll a, ll b) { return (a + b - 1) / b; }
unused inline ll mod(ll a, ll m = MOD) { return (a % m + m) % m; }
unused inline void modadd(ll &a, ll b, ll m = MOD) { a = mod(a + b, m); }
unused inline ll floordiv(ll a, ll b) { return a / b - (a < 0 && a % b); }
unused inline ll ceildiv(ll a, ll b) { return floordiv(a + b - 1, b); }
tempT unused inline bool in_range(T a, T x, T b) { return a <= x && x < b; }
unused inline bool in_range(ll x, ll b) { return in_range(0LL, x, b); }
tempT unused bool chmin(T &a, T b) { if(a > b) {a = b; return 1;} return 0; }
tempT unused bool chmax(T &a, T b) { if(a < b) {a = b; return 1;} return 0; }

int main() {
    int t; cin >> t;
    rep(i, t) {
        int n; string s, t, u;
        cin >> n >> s >> t >> u;
        cout << string(n, '0') << string(n, '1') << 0 << endl;
    }
}