#pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#include <bits/stdc++.h>
#include <math.h>
using namespace std;

void __print(bool x) {cerr << (x ? "true" : "false");}void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __print(long long x) {cerr << x;} void __print(unsigned x) {cerr << x;} void __print(unsigned long x) {cerr << x;} void __print(unsigned long long x) {cerr << x;} void __print(float x) {cerr << x;} void __print(double x) {cerr << x;} void __print(long double x) {cerr << x;} void __print(char x) {cerr << '\'' << x << '\'';} void __print(const char *x) {cerr << '"' << x << '"';} void __print(const string &x) {cerr << '"' << x << '"';} template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';} template<typename T> void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";} template <typename T, typename... V> void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define D(x...) cerr << "[" << #x << "] = ["; _print(x);
#else
#define D(x...)
#endif

typedef long long int ll; typedef long double ld; typedef pair<ll, ll> pl; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<pl> vpl; typedef vector<ld> vld; typedef vector<vld> vvld; typedef vector<bool> vb; typedef vector<string> vs;
#define oset tree<ll, null_type, less<>, rb_tree_tag,tree_order_statistics_node_update>
#define F(i, start, end) for(ll i = (start); i < (end); ++i)
#define FD(i, start, end) for(ll i = (start-1); i >= (end); --i)
#define A(x) (x).begin(), (x).end()
#define G(x) ll x; cin >> x;
ll I(ll &x) { cin >> x; return x; }
#define X first
#define Y second
#define TR(x, v) for (auto &x : v)
#define MULT G(T) while(T--)
template <typename T>
T read(ll n) { T x(n); F(i,0,n) cin >> x[i]; return x; }
#define R(T, x, n) { G(n) T x; F(i,0,n) cin >> }

ll MOD = 998244353; // 1000000007;
pair<ll, ll> dir[4] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
ll inv(ll a, ll b){return 1<a ? b - inv(b%a,a)*b/a : 1;}

#define NN

int main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    MULT{
        G(n)
        vs s(3);
        vector<ll> cnt1(3);
        F(i,0,3) {
            cin >> s[i];
            TR(x, s[i]) cnt1[i] += x == '1';
        }
        string a, b;
        char more;
        F(i,0,3) F(j,0,3)
            if ((i - j) and (cnt1[i] >= n) == (cnt1[j] >= n)) {
                a = s[i], b = s[j];
                if (cnt1[i] < n) more = '0'; else more = '1';
                if (more == '1' and cnt1[i] > cnt1[j]) swap(a, b);
                if (more == '0' and cnt1[i] < cnt1[j]) swap(a, b);
            }

        vector<ll> chunks;
        ll cur = 0;
        TR(x, a) {
            if (x == more) {
                chunks.push_back(cur);
                cur = 0;
            } else cur++;
        }
        if (cur) chunks.push_back(cur);
        string ans;
        cur = 0;
        TR(x, b) {
            if (x == more and cur < chunks.size()) {
                F(i,0,chunks[cur]) ans += (char)('0' + '1' - more);
                cur++;
            }
            ans += x;
        }
        while (cur < chunks.size()) {
            F(i,0,chunks[cur]) ans += (char)('0' + '1' - more);
            cur++;
        }
        cout << ans << endl;
    };
}
























































