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 PYTHON3):

Solution:
from sys import path_hooks, stdin, stdout
from collections import Counter,deque
import math
from copy import deepcopy
import random
import heapq
from itertools import permutations, product, repeat
from time import time

from bisect import bisect_left
from bisect import bisect_right
from re import A, findall
from fractions import Fraction
from typing import DefaultDict


def mapinput():
    return  map(int, stdin.readline().split())

def strinput():
    return stdin.readline().strip()

def listinput():
    return list(map(int,stdin.readline().split()))

def intinput():
    return int(stdin.readline().strip())



# int(stdin.readline().strip())
# stdin.readline().strip()
# list(map(int,stdin.readline().split()))
# map(int,stdin.readline().split())
'''
n = int(stdin.readline())
s = stdin.readline().strip()
n, k = map(int, stdin.readline().split())
arn = list(map(int, stdin.readline().split()))
'''

def gcd(a,b):
    if(b==0):
        return a
    else:
        return gcd(b,a%b)

def SieveOfEratosthenes(n):
    prime = [True for i in range(n + 1)]
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 1
    prime[0]= False
    prime[1]= False
    ans = []
    for p in range(n + 1):
        if prime[p]:
            ans.append(p)
    return ans

# t = time()
# primes = SieveOfEratosthenes(5000002)

# spprime = set([2,3,5,7])
# for i in primes:
#     if i//10 in spprime:
#         spprime.add(i)

# spprime = list(spprime)
# spprime.sort()

#print(time() - t)

#spprime = [2, 3, 5, 7, 23, 29, 31, 37, 53, 59, 71, 73, 79, 233, 239, 293, 311, 313, 317, 373, 379, 593, 599, 719, 733, 739, 797, 2333, 2339, 2393, 2399, 2939, 3119, 3137, 3733, 3739, 3793, 3797, 5939, 7193, 7331, 7333, 7393, 23333, 23339, 23399, 23993, 29399, 31193, 31379, 37337, 37339, 37397, 59393, 59399, 71933, 73331, 73939, 233993, 239933, 293999, 373379, 373393, 593933, 593993, 719333, 739391, 739393, 739397, 739399, 2339933, 2399333, 2939999, 3733799]
#spprimeset = set(spprime)

coprime1 = {6: 100003, 5: 10007, 4: 1009, 3: 101, 2: 11, 1: 2, 7: 1000003, 8: 10000019, 9: 100000007}
coprime2 = {8:10000169,9:100000049,7:1000033,6:100019,5:10009,4:1013,3:103,2:13,1:3}
 
def writ(ss):
    stdout.write(str(ss) + "\n")

mod = (10 **9) + 7

def binaryr(arr,point,target):
    low = 0
    high = point
    while low <= high:
        mid = (low+high)//2
        if arr[mid] == target:
            return mid 
        elif arr[mid] < target:
            low = mid + 1 
        else:
            high = mid - 1
    return low 

def binaryl(arr,point,target):
    low = 0
    high = point
    while low <= high:
        mid = (low+high)//2
        if arr[mid] == target:
            return mid 
        elif arr[mid] < target:
            low = mid + 1 
        else:
            high = mid - 1
    return high

def sump(n):
    return (n * (n+1)) // 2 

for test in range(intinput()):
    
    def solve():
        n , m = mapinput()
        s1 = []

        for i in range(n):
            s1.append(strinput())

        s2 = []
        for i in range(n-1):
            s2.append(strinput())

        dp = [[0]* 26 for i in range(m)]
        for i in range(n):
            for j in range(m):
                dp[j][  ord(s1[i][j]) - 97  ] += 1

        for i in range(n-1):
            for j in range(m):
                dp[j][  ord(s2[i][j]) - 97  ] -= 1

        for i in range(m):
            for j in range(26):
                if dp[i][j]> 0:
                    stdout.write(chr(97 + j))
                    break
            
    solve()
    print()