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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int mod = 1000 * 1000 * 1000 + 7;
const int INF = 1e9 + 100;
const ll LINF = 1e18 + 100;

#ifdef DEBUG
#define dbg(x) cout << #x << " = " << (x) << endl << flush;
#define dbgr(s, f) { cout << #s << ": "; for (auto _ = (s); _ != (f); _++) cout << *_ << ' '; cout << endl << flush; }
#else
#define dbg(x) ;
#define dbgr(s, f) ;
#endif
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define fast_io ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define endl '\n'

void tcase(void)
{
	int n;
	string s1, s2, s3;
	cin >> n >> s1 >> s2 >> s3;
	string ans;
	FOR(i, 0, n) ans += '0';
	FOR(i, 0, n) ans += '1';
	ans += '0';
	cout << ans << endl;
}

int32_t main(void)
{
	fast_io;
	int t;
	cin >> t;
	while (t--)
		tcase();
	return 0;
}


//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using ll = int64_t;
using ull = uint64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQG = priority_queue<T, vector<T>, greater<T>>;
const int INF = 0xccccccc;
const ll LINF = 0xcccccccccccccccLL;
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b && (a = b, true);}
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b && (a = b, true);}
template<typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) { return is >> p.first >> p.second;}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) { return os << p.first << ' ' << p.second;}



//head



int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while(t--) {
    int n;
    cin >> n;
    vs s(3);
    rep(i, 3) cin >> s[i];
    bool u = true;
    vi z(3, -1);
    rep(i, 3) if(s[i][0] == '0' and s[i][2*n-1] == '0') {
      u = false;
      z[i] = 0;
    }
    if(u) {
      cout << string(n, '0') + "1" + string(n, '0') << '\n';
      continue;
    }
    u = true;
    rep(i, 3) if(s[i][0] == '1' and s[i][2*n-1] == '1') {
      u = false;
      z[i] = 1;
    }
    if(u) {
      cout << string(n, '1') + "0" + string(n, '1') << '\n';
      continue;
    }
    bool done = false;
    rep(i, 3) if(z[i] == -1) {
      if(s[i][0] == '0') {
        cout << "0" + string(n, '1') + string(n, '0') << '\n';
      }
      else {
        cout << "1" + string(n, '0') + string(n, '1') << '\n';
      }
      done = true;
    }
    if(not done) {
        cout << "0" + string(n, '1') + string(n, '0') << '\n';
    }
  }
}