Problem: AquaMoon had n strings of length m each. n is an odd number.

When AquaMoon was gone, Cirno tried to pair these n strings together. After making (n-1)/(2) pairs, she found out that there was exactly one string without the pair!

In her rage, she disrupted each pair of strings. For each pair, she selected some positions (at least 1 and at most m) and swapped the letters in the two strings of this pair at the selected positions.

For example, if m = 6 and two strings "abcdef" and "xyzklm" are in one pair and Cirno selected positions 2, 3 and 6 she will swap 'b' with 'y', 'c' with 'z' and 'f' with 'm'. The resulting strings will be "ayzdem" and "xbcklf".

Cirno then stole away the string without pair and shuffled all remaining strings in arbitrary order.

AquaMoon found the remaining n-1 strings in complete disarray. Also, she remembers the initial n strings. She wants to know which string was stolen, but she is not good at programming. Can you help her?

Input

This problem is made as interactive. It means, that your solution will read the input, given by the interactor. But the interactor will give you the full input at the beginning and after that, you should print the answer. So you should solve the problem, like as you solve the usual, non-interactive problem because you won't have any interaction process. The only thing you should not forget is to flush the output buffer, after printing the answer. Otherwise, you can get an "Idleness limit exceeded" verdict. Refer to the [interactive problems guide](https://codeforces.com/blog/entry/45307) for the detailed information about flushing the output buffer.

The input consists of multiple test cases. The first line contains a single integer t (1 ≤ t ≤ 100) — the number of test cases.

The first line of each test case contains two integers n, m (1 ≤ n ≤ 10^5, 1 ≤ m ≤ 10^5) — the number of strings and the length of each string, respectively.

The next n lines each contain a string with length m, describing the original n strings. All string consists of lowercase Latin letters.

The next n-1 lines each contain a string with length m, describing the strings after Cirno exchanged and reordered them.

It is guaranteed that n is odd and that the sum of n ⋅ m over all test cases does not exceed 10^5.

Hack format:

The first line should contain a single integer t. After that t test cases should follow in the following format:

The first line should contain two integers n and m.

The following n lines should contain n strings of length m, describing the original strings.

The following (n-1)/(2) lines should describe the pairs. They should contain, in the following order: the index of the first string i (1 ≤ i ≤ n), the index of the second string j (1 ≤ j ≤ n, i ≠ j), the number of exchanged positions k (1 ≤ k ≤ m), and the list of k positions that are exchanged (k distinct indices from 1 to m in any order).

The final line should contain a permutation of integers from 1 to n, describing the way the strings should be reordered. The strings will be placed in the order indices placed in this permutation, the stolen string index will be ignored.

Output

For each test case print a single line with the stolen string.

Example

Input


3
3 5
aaaaa
bbbbb
ccccc
aaaaa
bbbbb
3 4
aaaa
bbbb
cccc
aabb
bbaa
5 6
abcdef
uuuuuu
kekeke
ekekek
xyzklm
xbcklf
eueueu
ayzdem
ukukuk


Output


ccccc
cccc
kekeke

Note

In the first test case, "aaaaa" and "bbbbb" exchanged all positions, and "ccccc" is the stolen string.

In the second test case, "aaaa" and "bbbb" exchanged two first positions, and "cccc" is the stolen string.

This is the first test in the hack format: 
    
    
      
    3  
    3 5  
    aaaaa  
    bbbbb  
    ccccc  
    1 2 5 1 2 3 4 5  
    2 1 3  
    3 4  
    aaaa  
    bbbb  
    cccc  
    1 2 2 1 2  
    2 1 3  
    5 6  
    abcdef  
    uuuuuu  
    kekeke  
    ekekek  
    xyzklm  
    1 5 3 2 3 6  
    2 4 3 2 4 6  
    5 4 1 2 3  
    

Solution (in JAVA):

Solution:
import java.util.*;
import java.lang.*;
import java.io.*;

public class Codeforces {
    static FastReader sc=new FastReader();
	static PrintWriter out=new PrintWriter(System.out);
	static long mod=1000000007;
	static long mod1=998244353;
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		int t=I();
		while(t-->0)
		{
			int n=I();
			int m=I();
			String s[]=new String[n];
			String s1[]=new String[n-1];
			for(int i=0;i<n;i++){
				s[i]=S();
			}
			HashMap<Character,Integer> ar[]=new HashMap[m];
			for(int i=0;i<m;i++){
				ar[i]=new HashMap<Character,Integer>();
			}
			for(int i=0;i<n;i++){
				String st=s[i];
				for(int j=0;j<m;j++){
					if(ar[j].containsKey(st.charAt(j))){
						ar[j].put(st.charAt(j),ar[j].get(st.charAt(j))+1);
					}else{
						ar[j].put(st.charAt(j),1);
					}
				}
			}
			// for(int i=0;i<m;i++){
			// 	for(Map.Entry<Character,Integer> e:ar[i].entrySet()){
			// 		out.println(e.getKey()+" "+e.getValue());
			// 	}
			// 	out.println();
			// }
			for(int i=0;i<n-1;i++){
				s1[i]=S();
			}
			// HashSet<Character> arr[]=new HashSet[m];
			// for(int i=0;i<m;i++){
			// 	arr[i]=new HashSet<Character>();
			// }
			// for(int i=0;i<n-1;i++){
			// 	for(int j=0;j<m;j++){
			// 		arr[j].add(s1[i].charAt(j));
			// 	}
			// }
			// int q=0;
			for(int i=0;i<n-1;i++){
				String st=s1[i];
				// int cnt=0;
				for(int j=0;j<m;j++){
					// if(!arr[j].contains(st.charAt(j))){cnt++;}
					// if(arr[j].contains(st.charAt(j))){
						if(ar[j].get(st.charAt(j))==1){
							ar[j].remove(st.charAt(j));
						}else{
							ar[j].put(st.charAt(j),ar[j].get(st.charAt(j))-1);
						}
					// }
				}
				// if(cnt!=0){
				// 	q=i;break;
				// }
			}
			StringBuffer sb=new StringBuffer();
			for(int i=0;i<m;i++){
				for(Map.Entry<Character,Integer> e:ar[i].entrySet()){
					sb.append(e.getKey());
				}
			}
			out.println(sb.toString());
			out.flush();
		}
		out.close();
	}
	public static long kadane(long a[],int n)
	{
		long max_sum=Long.MIN_VALUE,max_end=0;
		for(int i=0;i<n;i++){
			max_end+=a[i];
			if(max_sum<max_end){max_sum=max_end;}
			if(max_end<0){max_end=0;}
		}
		return max_sum;
	}
	public static void DFS(ArrayList<Integer> arr[],int s,boolean visited[])
	{
		visited[s]=true;
		for(int i:arr[s]){
			if(!visited[i]){
				DFS(arr,i,visited);
			}
		}
	}
	public static int BS(long a[],long x,int ii,int jj)
	{
		// int n=a.length;
		int mid=0;
		int i=ii,j=jj;
		while(i<j)
		{
			mid=(i+j)/2;
			if(a[mid]>x)
			j=mid-1;
			else if(a[mid]<x)
			i=mid+1;
			else return mid;
		}
		if(a[i]>x)
		return i-1;
		return i;
	}
	public static ArrayList<Integer> prime(int n)
	{
	    ArrayList<Integer> arr=new ArrayList<>();
	    boolean prime[] = new boolean[n + 1];
        for (int i = 0; i <= n; i++)
        prime[i] = true;
        for (int p = 2; p * p <= n; p++)
        {
            if (prime[p] == true)
            {
                for (int i = p * p; i <= n; i += p)
                prime[i] = false;
            }
        }
        for (int i = 2; i <= n; i++)
        {
            if (prime[i] == true)
            arr.add(i);
        }
        return arr;
	}
	public static HashSet<Integer> primeSet(int n)
	{
	    HashSet<Integer> arr=new HashSet<>();
	    boolean prime[] = new boolean[n + 1];
        for (int i = 0; i <= n; i++)
        prime[i] = true;
        for (int p = 2; p * p <= n; p++)
        {
            if (prime[p] == true)
            {
                for (int i = p * p; i <= n; i += p)
                prime[i] = false;
            }
        }
        for (int i = 2; i <= n; i++)
        {
            if (prime[i] == true)
            arr.add(i);
        }
        return arr;
	}

	// Fenwick / BinaryIndexed  Tree  USE IT - FenwickTree ft1=new FenwickTree(n);
	public static class FenwickTree
	{
		long farr[];
		int n;
		public FenwickTree(int c)
		{
			n=c+1;
			farr=new long[n];
		}
		public void update_range(int l,int r,long p)
		{
			update(l,p);
			update(r+1,(-1)*p);
		}
		public void update(int x,long p)
		{
			for(;x<n;x+=x&(-x))
			{
				farr[x]+=p;
			}
		}
		public long get(int x)
		{
			long ans=0;
			for(;x>0;x-=x&(-x))
			{
				ans=ans+farr[x];
			}
			return ans;
		}
	}

	//Disjoint Set Union
	public static class DSU
	{
	    static int par[],rank[];
	    public DSU(int c)
	    {
	        par=new int[c+1];
	        rank=new int[c+1];
	        for(int i=0;i<=c;i++)
	        {
	            par[i]=i;
	            rank[i]=0;
	        }
	    }
	    public static int find(int a)
	    {
	        if(a==par[a])
	        return a;
	        return par[a]=find(par[a]);
	    }
	    public static void union(int a,int b)
	    {
	        int a_rep=find(a),b_rep=find(b);
	        if(a_rep==b_rep)
	        return;
	        if(rank[a_rep]<rank[b_rep])
	        par[a_rep]=b_rep;
	        else if(rank[a_rep]>rank[b_rep])
	        par[b_rep]=a_rep;
	        else
	        {
	            par[b_rep]=a_rep;
	            rank[a_rep]++;
	        }
	    }
	}

	//SEGMENT TREE CODE

	// public static void segmentUpdate(int si,int ss,int se,int qs,int qe,long x)
	// {
	// 	if(ss>qe || se<qs)return;
	// 	if(qs<=ss && qe>=se)
	// 	{
	// 		seg[si][0]+=1L;
	// 		seg[si][1]+=x*x;
	// 		seg[si][2]+=2*x;
	// 		return;
	// 	}
	// 	int mid=(ss+se)/2;
	// 	segmentUpdate(2*si+1,ss,mid,qs,qe,x);
	// 	segmentUpdate(2*si+2,mid+1,se,qs,qe,x);
	// }
	// public static long segmentGet(int si,int ss,int se,int x,long f,long s,long t,long a[])
	// {
	// 	if(ss==se && ss==x)
	// 	{
	// 		f+=seg[si][0];
	// 		s+=seg[si][1];
	// 		t+=seg[si][2];
	// 		long ans=a[x]+(f*((long)x+1L)*((long)x+1L))+s+(t*((long)x+1L));
	// 		return ans;
	// 	}
	// 	int mid=(ss+se)/2;
	// 	if(x>mid){
	// 		return segmentGet(2*si+2,mid+1,se,x,f+seg[si][0],s+seg[si][1],t+seg[si][2],a);
	// 	}else{
	// 		return segmentGet(2*si+1,ss,mid,x,f+seg[si][0],s+seg[si][1],t+seg[si][2],a);
	// 	}
	// }

	public static class pair
    {
    	int a;
    	int b;
    	public pair(int val,int index)
    	{
    	    a=val;
    	    b=index;
    	}
    }
	public static class myComp implements Comparator<pair>
	{
		//sort in ascending order.
		// public int compare(pair p1,pair p2)
		// {
		// 	if(p1.a==p2.a)
    	//     return 0;
    	//     else if(p1.a<p2.a)
    	//     return -1;
    	//     else
    	//     return 1;
		// }
		//sort in descending order.
		public int compare(pair p1,pair p2)
    	{
    	    if(p1.a==p2.a)
    	    return 0;
    	    else if(p1.a<p2.a)
    	    return 1;
    	    else
    	    return -1;
    	}
	}
    public static class myComp1 implements Comparator<pair1>
    {
		//sort in ascending order.
    	public int compare(pair1 p1,pair1 p2)
    	{
    	    if(p1.a==p2.a)
    	    return 0;
    	    else if(p1.a<p2.a)
    	    return -1;
    	    else
    	    return 1;
    	}
		//sort in descending order.
		// public int compare(pair p1,pair p2)
    	// {
    	//     if(p1.a==p2.a)
    	//     return 0;
    	//     else if(p1.a<p2.a)
    	//     return 1;
    	//     else
    	//     return -1;
    	// }
    }
	public static class pair1
    {
    	long a;
    	long b;
    	public pair1(long val,long index)
    	{
    	    a=val;
    	    b=index;
    	}
    }
    public static ArrayList<pair1> mergeIntervals(ArrayList<pair1> arr)
	{
	    //****************use this in main function-Collections.sort(arr,new myComp1());
	    ArrayList<pair1> a1=new ArrayList<>();
	    if(arr.size()<=1)
	    return arr;
	    a1.add(arr.get(0));
	    int i=1,j=0;
	    while(i<arr.size())
	    {
	        if(a1.get(j).b<arr.get(i).a)
	        {
	           a1.add(arr.get(i));
	           i++;
	           j++;
	        }
	        else if(a1.get(j).b>arr.get(i).a && a1.get(j).b>=arr.get(i).b)
	        {
	            i++;
	        }
	        else if(a1.get(j).b>=arr.get(i).a)
	        {
	            long a=a1.get(j).a;
	            long b=arr.get(i).b;
	            a1.remove(j);
	            a1.add(new pair1(a,b));
	            i++;
	        }
	    }
	    return a1;
	}
	public static boolean palindrome(String s,int n)
	{
		for(int i=0;i<=n/2;i++){
			if(s.charAt(i)!=s.charAt(n-i-1)){
				return false;
			}
		}
		return true;
	}
	public static long countDigit(long n)
	{
	    long sum=0;
	    while(n!=0)
	    {
	        sum++;
	        n=n/10;
	    }
	    return sum;
	}
	public static long digitSum(long n)
	{
	    long sum=0;
	    while(n!=0)
	    {
	        sum=sum+n%10;
	        n=n/10;
	    }
	    return sum;
	}
	public static long gcd(long a,long b)
	{
	    if(b==0)
	    return a;
	    else
	    return gcd(b,a%b);
	}
	public static int gcd(int a,int b)
	{
	    if(b==0)
	    return a;
	    else
	    return gcd(b,a%b);
	}
	public static void printArray(long a[])
	{
		for(int i=0;i<a.length;i++){
			out.print(a[i]+" ");
		}
		out.println();
	}
	public static void printArray(ArrayList<Long> arr)
	{
		for(int i=0;i<arr.size();i++){
			out.print(arr.get(i)+" ");
		}
		out.println();
	}
	public static long pwr(long m,long n)
	{
		long res=1;
		m=m%mod;
		if(m==0)
		return 0;
		while(n>0)
		{
			if((n&1)!=0)
			{
				res=(res*m)%mod;
			}
			n=n>>1;
			m=(m*m)%mod;
		}
		return res;
	}
	public static void sort(int[] A)
	{
        int n = A.length;
        Random rnd = new Random();
        for(int i=0; i<n; ++i)
		{
            int tmp = A[i];
            int randomPos = i + rnd.nextInt(n-i);
            A[i] = A[randomPos];
            A[randomPos] = tmp;
        }
        Arrays.sort(A);
    }
    public static void sort(long[] A)
	{
	    int n = A.length;
        Random rnd = new Random();
        for(int i=0; i<n; ++i)
		{
            long tmp = A[i];
            int randomPos = i + rnd.nextInt(n-i);
            A[i] = A[randomPos];
            A[randomPos] = tmp;
        }
	    Arrays.sort(A);
	}
	public static int I(){return sc.I();}
    public static long L(){return sc.L();}
    public static String S(){return sc.S();}
    public static double D(){return sc.D();}
}
class FastReader {  
    BufferedReader br;
    StringTokenizer st;
    public FastReader(){
        br = new BufferedReader(new InputStreamReader(System.in));
    }
    String next(){
        while (st == null || !st.hasMoreElements()){
            try {
                st = new StringTokenizer(br.readLine());
            }
            catch (IOException e){
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }
    int I(){ 
        return Integer.parseInt(next());
    }
    long L(){ 
        return Long.parseLong(next());
    }
    double D(){
         return Double.parseDouble(next());
    }
    String S(){
        String str = "";
        try 
        {
            str = br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}