#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define sortv(v) sort(v.begin(),v.end())
#define sorta(A,N) sort(A,A+N)
#define rep(i,a,N) for(ll i=a;i<N;i++)
#define test(T) ll T; cin>>T; while(T--)
#define f first
#define s second
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
ll gcd(ll a,ll b){
    if(!a)
        return b;
    else
        return gcd(b%a,a);
}
ll power(ll a,ll b,ll mod=MOD){
    a%=mod;
    ll res=1;
    while(b){
        if(b&1)
            res=res*a%mod;
        a=a*a%mod;
        b>>=1;
    }
    return res;
}/*
ll N=1e6+1;
vector<ll>prime(N);
void sieve(){
    rep(i,0,N) prime[i]=i;
    for(ll i=4;i<N;i+=2)
        prime[i]=2;
    for(ll i=3;i*i<N;i+=2){
        if(prime[i]==i)
            for(ll j=i*i;j<N;j+=i)
                if(prime[j]==j)
                    prime[j]=i;
    }
}
vector<ll> factor(ll N){
    vector<ll> fac;
    while(N!=1){
        fac.pb(prime[N]);
        N/=prime[N];
    }
    return fac;
}*/
void solve(){
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll N;
    cin>>N;
    string s1,s2,s3;
    cin>>s1>>s2>>s3;
    cout<<string(N,'0')<<string(N,'1')<<"0\n";
}
int main(){
    speed;
    test(T){
        solve();
    }
}

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr ll mod=1e9+7;

int main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int t;
  cin>>t;
  for (int i = 0; i < t; ++i)
  {
    int n;
    cin>>n;
    string s;
    bool one = false, zero = false;
    for (int i = 0; i < 3; ++i)
    {
      cin>>s;
      if (s.front() == '0' && s.back() == '0') zero = true;
      else if (s.front() == '1' && s.back() == '1') one = true;
    }
    if (zero && one) {
      cout << 1;
      for (int i = 0; i < n; ++i)
      {
        cout << 0;
      }
      for (int i = 0; i < n; ++i)
      {
        cout << 1;
      }
    } else if (zero) {
      for (int j = 0; j < n; ++j)
      {
        cout << 1;
      }
      cout << 0;
      for (int j = 0; j < n; ++j)
      {
        cout << 1;
      }
    } else {
      for (int j = 0; j < n; ++j)
      {
        cout << 0;
      }
      cout << 1;
      for (int j = 0; j < n; ++j)
      {
        cout << 0;
      }
    }
    cout << "\n";
  }
}