#include<iostream>
using namespace std;
main(){int T;cin>>T;for(int i=0;i<T;i++){int N;cin>>N;char ch;for(int j=0;j<3;j++){for(int k=0;k<2*N;k++)cin>>ch;}cout<<0;for(int k=0;k<N;k++){cout<<1;}for(int k=0;k<N;k++){cout<<0;}cout<<endl;}}
#include <bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define M1 1000000007
#define M2 998244353
#define INF 1e18
#define ll  long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPR(i,a,b) for(ll i=b-1;i>=a;i--)
#define forr(i,n) for(ll i=0;i<n;i++)
#define F first
#define S second
#define pb push_back
#define DB pop_back
#define mp make_pair
#define MT make_tuple
#define V(a) vector<a>
#define vi vector<int>
#define vlli vector <long long>
#define endl '\n'
#define ce(ele) cout<<ele<<' '
#define cs(ele) cout<<ele<<'\n'
#define CASE(t) ll t; cin>>t; while(t--)
/************************/
const double pi = 3.1415926535;
/************************/
//FAST IO//

/************************/

 int power(long long x, unsigned int y, int p)
{
    int res = 1;     // Initialize result
 
    x = x % p; // Update x if it is more than or
                // equal to p
  
    if (x == 0) return 0; // In case x is divisible by p;
 
    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;
 
        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}


const ll int  nax = 2e5 + 5;
vector<ll int > edges[nax], vis(nax, 0);
ll int p= 0;

void dfs(ll int node) {
    p++;
    vis[node] = 1;
    for(ll int x: edges[node]) {
        if(vis[x] == 0) {
            dfs(x);
        }
    }
}

int main() {
    
   ll int t;
   t=1;
   //cin>>t;
   while(t--)
   {
        
    ll int  n;
    cin >> n;
    vector<ll int > arr(n);
    for(ll int i = 0; i < n; i++)
    {
        cin >> arr[i];
    }
    for(ll int  i = 0; i < n; ++i)
    {
        edges[arr[i]].push_back(arr[n - i - 1]);
        edges[arr[n - i - 1]].push_back(arr[i]);
    }
    ll int answer = 0;
    for(ll int i = 0; i < nax; ++i) {
        if(vis[i] == 0) {
            p = 0;
            dfs(i);
            answer = answer + max(0ll, p - 1);
        }
    }
    cout << answer << endl;

   }
   return 0;
}




















