Problem: A bitstring is a string that contains only the characters 0 and 1.

Koyomi Kanou is working hard towards her dream of becoming a writer. To practice, she decided to participate in the Binary Novel Writing Contest. The writing prompt for the contest consists of three bitstrings of length 2n. A valid novel for the contest is a bitstring of length at most 3n that contains at least two of the three given strings as subsequences.

Koyomi has just received the three prompt strings from the contest organizers. Help her write a valid novel for the contest.

A string a is a subsequence of a string b if a can be obtained from b by deletion of several (possibly, zero) characters.

Input

The first line contains a single integer t (1 ≤ t ≤ 10^4) — the number of test cases.

The first line of each test case contains a single integer n (1 ≤ n ≤ 10^5).

Each of the following three lines contains a bitstring of length 2n. It is guaranteed that these three strings are pairwise distinct.

It is guaranteed that the sum of n across all test cases does not exceed 10^5.

Output

For each test case, print a single line containing a bitstring of length at most 3n that has at least two of the given bitstrings as subsequences.

It can be proven that under the constraints of the problem, such a bitstring always exists.

If there are multiple possible answers, you may output any of them.

Example

Input


2
1
00
11
01
3
011001
111010
010001


Output


010
011001010

Note

In the first test case, the bitstrings 00 and 01 are subsequences of the output string: 010 and 010. Note that 11 is not a subsequence of the output string, but this is not required.

In the second test case all three input strings are subsequences of the output string: 011001010, 011001010 and 011001010.

Solution (in JAVA):

Solution:
import java.io.*;import java.util.*;import java.math.*;
public class Main
{
	int k;
	public void tq()throws Exception
	{
//		int v=1024*4;
//		int pp=0;
//		for(int x=0;x<v;x++)
//		{
//			for(int y=0;y<v;y++)
//			{
//				for(int z=0;z<v;z++)
//				{
//					pp++;
//					if(pp==1000000)
//					{
//						pl("h");
//						return;
//					}
//					String a=Integer.toBinaryString(x);
//					String b=Integer.toBinaryString(y);
//					String c=Integer.toBinaryString(z);
//					while(a.length()!=12)a="0"+a;
//					while(b.length()!=12)b="0"+b;
//					while(c.length()!=12)c="0"+c;
//					k=18;
//					String aa=f(a.toCharArray(),b.toCharArray(),12);
//					String bb=f(a.toCharArray(),c.toCharArray(),12);
//					String cc=f(b.toCharArray(),c.toCharArray(),12);
//					if(aa==null&&bb==null&&cc==null)
//					{
//						pl(a);
//						pl(b);
//						pl(c);
//						pl(-1);
//						return;
//					}
//				}
//			}
//		}
//		pl(111);
		st=new StringTokenizer(br.readLine());
		int tq=i();
		sb=new StringBuilder(1000000);
		o:
		while(tq-->0)
		{
			int n=i();
			int m=n<<1;
			k=3*n;
			char ar[][]=new char[3][];
			for(int x=0;x<3;x++)ar[x]=s().toCharArray();
			String f=f(ar[0],ar[1],m);
			if(f!=null)
			{
				//pl("   "+f);
				sl(f);
				continue o;
			}
			
			f=f(ar[0],ar[2],m);
			if(f!=null)
			{
				sl(f);
				continue o;
			}
			
			f=f(ar[1],ar[2],m);
			if(f!=null)
			{
				sl(f);
				continue o;
			}
			sl("-1");
		}
		p(sb);
	}
	String f(char a[],char b[],int n)
	{
		char f[]=new char[k];
		int i=0;
		for(int x=0;x<k;x++)f[x]='0';
		int za=0;
		int zb=0;
		int oa=0;
		int ob=0;
		for(char x:a)
		{
			if(x=='0')za++;
			else oa++;
		}
		for(char x:b)
		{
			if(x=='0')zb++;
			else ob++;
		}
		int h=n/2;
		if(za>=h)
		{
			if(zb>=h)
			{
				int ii=0;
				int jj=0;
				int pi=-1;
				int pj=-1;
				while(ii<n&&jj<n)
				{
					if(a[ii]=='0'&&b[jj]=='0')
					{
						int v=max(ii-pi-1,jj-pj-1);
						while(v-->0)f[i++]='1';
						f[i++]='0';
						pi=ii;
						pj=jj;
						ii++;
						jj++;
					}
					else
					{
						if(a[ii]=='1')ii++;
						if(b[jj]=='1')jj++;
					}
				}
				ii=pi+1;
				jj=pj+1;
				while(ii<n)f[i++]=a[ii++];
				while(jj<n)f[i++]=b[jj++];
				return new String(f);
			}
		}
		if(oa>=h)
		{
			if(ob>=h)
			{
				int ii=0;
				int jj=0;
				int pi=-1;
				int pj=-1;
				while(ii<n&&jj<n)
				{
					if(a[ii]=='1'&&b[jj]=='1')
					{
						int v=max(ii-pi-1,jj-pj-1);
						while(v-->0)f[i++]='0';
						f[i++]='1';
						pi=ii;
						pj=jj;
						ii++;
						jj++;
					}
					else
					{
						if(a[ii]=='0')ii++;
						if(b[jj]=='0')jj++;
					}
				}
				ii=pi+1;
				jj=pj+1;
				while(ii<n)f[i++]=a[ii++];
				while(jj<n)f[i++]=b[jj++];
				return new String(f);
			}
		}
		return null;
	}
    
    long mod=1000000007l;int max=Integer.MAX_VALUE,min=Integer.MIN_VALUE;
    long maxl=Long.MAX_VALUE,minl=Long.MIN_VALUE;
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st;StringBuilder sb;
    public static void main(String[] a)throws Exception{new Main().tq();}
    int[] so(int ar[]){Integer r[]=new Integer[ar.length];for(int x=0;x<ar.length;x++)r[x]=ar[x];
    Arrays.sort(r);for(int x=0;x<ar.length;x++)ar[x]=r[x];return ar;}
    long[] so(long ar[]){Long r[]=new Long[ar.length];for(int x=0;x<ar.length;x++)r[x]=ar[x];
    Arrays.sort(r);for(int x=0;x<ar.length;x++)ar[x]=r[x];return ar;}
    char[] so(char ar[])
    {Character r[]=new Character[ar.length];for(int x=0;x<ar.length;x++)r[x]=ar[x];
    Arrays.sort(r);for(int x=0;x<ar.length;x++)ar[x]=r[x];return ar;}
    void s(String s){sb.append(s);}void s(int s){sb.append(s);}void s(long s){sb.append(s);}
    void s(char s){sb.append(s);}void s(double s){sb.append(s);}
    void ss(){sb.append(' ');}void sl(String s){sb.append(s);sb.append("\n");}
    void sl(int s){sb.append(s);sb.append("\n");}
    void sl(long s){sb.append(s);sb.append("\n");}void sl(char s){sb.append(s);sb.append("\n");}
    void sl(double s){sb.append(s);sb.append("\n");}void sl(){sb.append("\n");}
    int min(int a,int b){return a<b?a:b;}
    int min(int a,int b,int c){return a<b?a<c?a:c:b<c?b:c;}
    int max(int a,int b){return a>b?a:b;}
    int max(int a,int b,int c){return a>b?a>c?a:c:b>c?b:c;}
    long min(long a,long b){return a<b?a:b;}
    long min(long a,long b,long c){return a<b?a<c?a:c:b<c?b:c;}
    long max(long a,long b){return a>b?a:b;}
    long max(long a,long b,long c){return a>b?a>c?a:c:b>c?b:c;}
    int abs(int a){return Math.abs(a);}
    long abs(long a){return Math.abs(a);}
    int sq(int a){return (int)Math.sqrt(a);}long sq(long a){return (long)Math.sqrt(a);}
    long gcd(long a,long b){while(b>0l){long c=a%b;a=b;b=c;}return a;}
    int gcd(int a,int b){while(b>0){int c=a%b;a=b;b=c;}return a;}
    boolean pa(String s,int i,int j){while(i<j)if(s.charAt(i++)!=s.charAt(j--))return false;return true;}
    boolean[] si(int n)
    {boolean bo[]=new boolean[n+1];bo[0]=true;bo[1]=true;for(int x=4;x<=n;x+=2)bo[x]=true;
    for(int x=3;x*x<=n;x+=2){if(!bo[x]){int vv=(x<<1);for(int y=x*x;y<=n;y+=vv)bo[y]=true;}}
    return bo;}long mul(long a,long b,long m) 
    {long r=1l;a%=m;while(b>0){if((b&1)==1)r=(r*a)%m;b>>=1;a=(a*a)%m;}return r;}
    int i()throws IOException{if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
    return Integer.parseInt(st.nextToken());}
    long l()throws IOException{if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
    return Long.parseLong(st.nextToken());}String s()throws IOException
    {if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());return st.nextToken();}
    double d()throws IOException{if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
    return Double.parseDouble(st.nextToken());}void p(Object p){System.out.print(p);}
    void p(String p){System.out.print(p);}void p(int p){System.out.print(p);}
    void p(double p){System.out.print(p);}void p(long p){System.out.print(p);}
    void p(char p){System.out.print(p);}void p(boolean p){System.out.print(p);}
    void pl(Object p){System.out.println(p);}void pl(String p){System.out.println(p);}
    void pl(int p){System.out.println(p);}void pl(char p){System.out.println(p);}
    void pl(double p){System.out.println(p);}void pl(long p){System.out.println(p);}
    void pl(boolean p){System.out.println(p);}void pl(){System.out.println();}
    void s(int a[]){for(int e:a){sb.append(e);sb.append(' ');}sb.append("\n");}
    void s(long a[]){for(long e:a){sb.append(e);sb.append(' ');}sb.append("\n");}
    void s(int ar[][]){for(int a[]:ar){for(int e:a){sb.append(e);sb.append(' ');}sb.append("\n");}}
    void s(char a[]){for(char e:a){sb.append(e);sb.append(' ');}sb.append("\n");}
    void s(char ar[][]){for(char a[]:ar){for(char e:a){sb.append(e);sb.append(' ');}sb.append("\n");}}
    int[] ari(int n)throws IOException
    {int ar[]=new int[n];if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
    for(int x=0;x<n;x++)ar[x]=Integer.parseInt(st.nextToken());return ar;}
    int[][] ari(int n,int m)throws IOException
    {int ar[][]=new int[n][m];for(int x=0;x<n;x++){if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
    for(int y=0;y<m;y++)ar[x][y]=Integer.parseInt(st.nextToken());}return ar;}
    long[] arl(int n)throws IOException
    {long ar[]=new long[n];if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
    for(int x=0;x<n;x++) ar[x]=Long.parseLong(st.nextToken());return ar;}
    long[][] arl(int n,int m)throws IOException
    {long ar[][]=new long[n][m];for(int x=0;x<n;x++)
    {if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
    for(int y=0;y<m;y++)ar[x][y]=Long.parseLong(st.nextToken());}return ar;}
    String[] ars(int n)throws IOException
    {String ar[]=new String[n];if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
    for(int x=0;x<n;x++) ar[x]=st.nextToken();return ar;}
    double[] ard(int n)throws IOException
    {double ar[]=new double[n];if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
    for(int x=0;x<n;x++)ar[x]=Double.parseDouble(st.nextToken());return ar;}
    double[][] ard(int n,int m)throws IOException
    {double ar[][]=new double[n][m];for(int x=0;x<n;x++)
    {if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
    for(int y=0;y<m;y++)ar[x][y]=Double.parseDouble(st.nextToken());}return ar;}
    char[] arc(int n)throws IOException{char ar[]=new char[n];if(!st.hasMoreTokens())st=new StringTokenizer(br.readLine());
    for(int x=0;x<n;x++)ar[x]=st.nextToken().charAt(0);return ar;}
    char[][] arc(int n,int m)throws IOException{char ar[][]=new char[n][m];
    for(int x=0;x<n;x++){String s=br.readLine();for(int y=0;y<m;y++)ar[x][y]=s.charAt(y);}return ar;}
    void p(int ar[]){StringBuilder sb=new StringBuilder(2*ar.length);
    for(int a:ar){sb.append(a);sb.append(' ');}System.out.println(sb);}
    void p(int ar[][]){StringBuilder sb=new StringBuilder(2*ar.length*ar[0].length);
    for(int a[]:ar){for(int aa:a){sb.append(aa);sb.append(' ');}sb.append("\n");}p(sb);}
    void p(long ar[]){StringBuilder sb=new StringBuilder(2*ar.length);
    for(long a:ar){sb.append(a);sb.append(' ');}System.out.println(sb);}
    void p(long ar[][]){StringBuilder sb=new StringBuilder(2*ar.length*ar[0].length);
    for(long a[]:ar){for(long aa:a){sb.append(aa);sb.append(' ');}sb.append("\n");}p(sb);}
    void p(String ar[]){int c=0;for(String s:ar)c+=s.length()+1;StringBuilder sb=new StringBuilder(c);
    for(String a:ar){sb.append(a);sb.append(' ');}System.out.println(sb);}
    void p(double ar[]){StringBuilder sb=new StringBuilder(2*ar.length);
    for(double a:ar){sb.append(a);sb.append(' ');}System.out.println(sb);}
    void p(double ar[][]){StringBuilder sb=new StringBuilder(2*ar.length*ar[0].length);
    for(double a[]:ar){for(double aa:a){sb.append(aa);sb.append(' ');}sb.append("\n");}p(sb);}
    void p(char ar[]){StringBuilder sb=new StringBuilder(2*ar.length);
    for(char aa:ar){sb.append(aa);sb.append(' ');}System.out.println(sb);}
    void p(char ar[][]){StringBuilder sb=new StringBuilder(2*ar.length*ar[0].length);
    for(char a[]:ar){for(char aa:a){sb.append(aa);sb.append(' ');}sb.append("\n");}p(sb);}
}