As a human, she can erase history of its entirety. As a Bai Ze (Hakutaku), she can create history out of nothingness.

—Perfect Memento in Strict Sense

Keine has the ability to manipulate history.

The history of Gensokyo is a string $s$ of length $1$ initially. To fix the chaos caused by Yukari, she needs to do the following operations $n$ times, for the $i$-th time:

She chooses a non-empty substring $t_{2i-1}$ of $s$.

She replaces $t_{2i-1}$ with a non-empty string, $t_{2i}$. Note that the lengths of strings $t_{2i-1}$ and $t_{2i}$ can be different.

Note that if $t_{2i-1}$ occurs more than once in $s$, exactly one of them will be replaced.

For example, let $s=$"marisa", $t_{2i-1}=$"a", and $t_{2i}=$"z". After the operation, $s$ becomes "mzrisa" or "marisz".

After $n$ operations, Keine got the final string and an operation sequence $t$ of length $2n$. Just as Keine thinks she has finished, Yukari appears again and shuffles the order of $t$. Worse still, Keine forgets the initial history.

Help Keine find the initial history of Gensokyo!

Recall that a substring is a sequence of consecutive characters of the string. For example, for string "abc" its substrings are: "ab", "c", "bc" and some others. But the following strings are not its substring: "ac", "cba", "acb".

Hacks

You cannot make hacks in this problem.


-----Input-----

Each test contains multiple test cases. The first line contains a single integer $T$ ($1 \leq T \leq 10^3$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $n$ ($1 \le n < 10 ^ 5$) — the number of operations.

The next $2n$ lines contains one non-empty string $t_{i}$ — the $i$-th string of the shuffled sequence $t$.

The next line contains one non-empty string $s$ — the final string.

It is guaranteed that the total length of given strings (including $t_i$ and $s$) over all test cases does not exceed $2 \cdot 10 ^ 5$. All given strings consist of lowercase English letters only.

It is guaranteed that the initial string exists. It can be shown that the initial string is unique.


-----Output-----

For each test case, print the initial string in one line.


-----Examples-----

Input
2
2
a
ab
b
cd
acd
3
z
a
a
aa
yakumo
ran
yakumoran
Output
a
z


-----Note-----

Test case 1:

Initially $s$ is "a".

In the first operation, Keine chooses "a", and replaces it with "ab". $s$ becomes "ab".

In the second operation, Keine chooses "b", and replaces it with "cd". $s$ becomes "acd".

So the final string is "acd", and $t=[$"a", "ab", "b", "cd"$]$ before being shuffled.

Test case 2:

Initially $s$ is "z".

In the first operation, Keine chooses "z", and replaces it with "aa". $s$ becomes "aa".

In the second operation, Keine chooses "a", and replaces it with "ran". $s$ becomes "aran".

In the third operation, Keine chooses "a", and replaces it with "yakumo". $s$ becomes "yakumoran".

So the final string is "yakumoran", and $t=[$"z", "aa", "a", "ran", "a", "yakumo"$]$ before being shuffled.

Source: codeforces | Difficulty: MEDIUM_HARD
Tags: Greedy algorithms

String algorithms

Constructive algorithms


Solutions:
from sys import stdin
input = stdin.readline

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))
for _ in range(ii()):
	n = ii()
	l_t = []
	for i in range(2 * n):
		t = input().strip()
		l_t.append(t)
	s = input().strip()
	st = ''.join(l_t) + s
	ans = ''
	for i in range(ord('a'), ord('z') + 1):
		ch = chr(i)
		if st.count(ch) % 2:
			ans = ch
			break
	print(ans)


import sys
input = sys.stdin.readline

def solve():
	cnt = [0] * 26
	n = int(input())
	arr = list((input().strip() for _ in range(2 * n)))
	arr.append(input().strip())
	for i in range(len(arr)):
		for c in arr[i]:
			cnt[ord(c) - ord('a')] += 1
	for i in range(26):
		if cnt[i] % 2:
			return list('abcdefghijklmnopqrstuvwxyz')[i]
	return -1
for _ in range(int(input())):
	print(solve())


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	count = [0] * 26
	for i in range(2 * n + 1):
		t = input().strip()
		for c in t:
			count[ord(c) - ord('a')] ^= 1
	for k in range(26):
		if count[k]:
			print(chr(k + ord('a')))
			break


for _ in range(int(input())):
	n = int(input())
	s = ''.join((input() for _ in range(2 * n + 1)))
	for ch in s:
		if s.count(ch) % 2:
			print(ch)
			break


for j in range(int(input())):
	n = int(input())
	s = ''.join((input() for i in range(2 * n + 1)))
	for c in s:
		if s.count(c) % 2:
			print(c)
			break


for t in range(int(input())):
	s = ''.join([*(input() for x in '_' * (int(input()) * 2 + 1))])
	for i in s:
		if s.count(i) % 2:
			print(i)
			break


from collections import Counter

def solve():
	n = int(input())
	arr = []
	for _ in range(2 * n):
		arr.append(input())
	out = list(input())
	newarr = list(''.join(arr))
	count_arr = Counter(newarr)
	count_out = Counter(out)
	count_arr.subtract(count_out)
	for (i, j) in count_arr.items():
		if j % 2 != 0:
			print(i)
cases = int(input())
for i in range(cases):
	solve()


import collections

def solve():
	n = int(input())
	cnt = collections.defaultdict(int)
	for i in range(2 * n + 1):
		inp = input()
		for c in inp:
			cnt[c] = (cnt[c] + 1) % 2
	res = 0
	for i in range(26):
		ch = chr(ord('`') + i + 1)
		if cnt[ch] == 1:
			print(ch)
			res += 1
	if res != 1:
		assert True

def main():
	t = int(input())
	for i in range(t):
		solve()
	return 0
main()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = [0 for i in range(26)]
	for i in range(2 * n + 1):
		s = input()[:-1]
		l = len(s)
		for i in range(l):
			c = s[i]
			ind = ord(c) - ord('a')
			a[ind] += 1
	for i in range(26):
		if a[i] % 2:
			ans = chr(i + ord('a'))
	print(ans)


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	res = 0
	d = defaultdict(int)
	for _ in range(2 * n + 1):
		s = input()
		for el in s:
			d[el] += 1
	for el in sorted(d):
		if d[el] % 2:
			print(el)
			break


import sys
import collections
from math import ceil, gcd, sqrt, log
import bisect
INF = float('inf')
mod = 1000000007

def solve():
	n = int(input())
	net = [0] * 26
	for i in range(2 * n):
		s = input()
		for c in s:
			net[ord(c) - 97] += 1
	s = input()
	for j in s:
		net[ord(j) - 97] += 1
	for i in range(26):
		if net[i] % 2 == 1:
			ans = chr(97 + i)
			break
	print(ans)
t = int(input())
while t != 0:
	solve()
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = {}
	for i in range(2 * n + 1):
		for j in input():
			a[j] = a.get(j, 0) + 1
	for i in a:
		if a[i] % 2:
			print(i)
			break


for _ in range(int(input())):
	ltrs = {}
	n = int(input())
	for _ in range(2 * n + 1):
		for elem in input():
			ltrs[elem] = ltrs.get(elem, 0) + 1
	for letter in ltrs:
		if ltrs[letter] % 2:
			print(letter)
			break


from collections import Counter
T = int(input())
while T:
	T -= 1
	n = int(input())
	s = ''
	for i in range(2 * n + 1):
		s += input()
	cnt = Counter(s)
	for (key, val) in cnt.items():
		if val % 2 == 1:
			print(key)
			break


def solve():
	n = int(input())
	freq = [0] * 26
	for i in range(2 * n + 1):
		s = input()
		for ch in s:
			freq[ord(ch) - ord('a')] += 1
	for i in range(26):
		if freq[i] % 2:
			print(chr(97 + i))
			return
for _ in range(int(input())):
	solve()


alpha = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
t = int(input())
for i in range(t):
	n = int(input())
	dic = [0 for i in range(26)]
	for i in range(2 * n):
		s = input()
		for j in s:
			dic[alpha[j]] += 1
	s = input()
	for j in s:
		dic[alpha[j]] += 1
	st = 'abcdefghijklmnopqrstuvwxyz'
	for i in range(26):
		if dic[i] % 2 != 0:
			print(st[i])
			break


t = int(input())
for e in range(t):
	a = []
	h = {}
	alp = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	for i in alp:
		h[i] = 0
	n = int(input())
	for i in range(2 * n + 1):
		s = input()
		for t in s:
			h[t] += 1
	for k in h:
		if h[k] % 2 != 0:
			print(k)
			break


for test in range(int(input())):
	n = int(input())
	freq = [0] * 26
	for __ in range(2 * n + 1):
		s = input()
		for ch in s:
			freq[ord(ch) - 97] += 1
	ans = 'a'
	for i in range(26):
		if freq[i] % 2 == 1:
			print(chr(97 + i))
			break


from random import getrandbits
RANDOM = getrandbits(32)

class Wrapper(int):

	def __init__(self, x):
		int.__init__(x)

	def __hash__(self):
		return super(Wrapper, self).__hash__() ^ RANDOM
T = int(input())
q = []
for i in range(T):
	n = int(input())
	data = []
	for i in range(n * 2):
		data.append(input())
	s = input()
	q.append((n, data, s))

def solve(n, data, s):
	chars = dict()
	for d in data:
		for c in d:
			if c not in chars:
				chars[c] = 0
			chars[c] += 1
	for c in s:
		chars[c] -= 1
	for c in chars:
		if chars[c] % 2:
			print(c)
			break
for (n, data, s) in q:
	solve(n, data, s)


for _ in range(int(input())):
	n = int(input())
	l = [0 for i in range(26)]
	for i in range(2 * n + 1):
		for val in input():
			l[ord(val) - 97] ^= 1
	for i in range(26):
		if l[i] == 1:
			print(chr(97 + i))


R = lambda : map(int, input().split())
(t,) = R()
for _ in range(t):
	d = {}
	(n,) = R()
	x = ''
	for i in range(2 * n + 1):
		s = input()
		x += s
	s1 = set(x)
	for j in s1:
		c = x.count(j)
		if c % 2 != 0:
			print(j)
			break


from collections import Counter
for t in range(int(input())):
	n = int(input())
	s = ''
	for i in range(2 * n + 1):
		s += input()
	s = Counter(s)
	for (x, y) in s.items():
		if y % 2:
			print(x)
			break


import io, os

def ri():
	return int(input().strip())

def rl():
	return list(map(int, input().strip().split()))

def Solve():
	n = ri()
	cnt = [0] * 256
	for i in range(2 * n + 1):
		s = input()
		for c in s:
			cnt[ord(c)] += 1
	for i in range(256):
		if cnt[i] & 1:
			print(chr(i))
			return
T = ri()
while T:
	T -= 1
	Solve()


import string
alphabet_string = string.ascii_lowercase
alphabet = list(alphabet_string)
T = int(input())
for testcase in range(1, T + 1):
	c = {}
	for letter in alphabet:
		c[letter] = False
	n = int(input())
	for i in range(2 * n + 1):
		s = input()
		for letter in s:
			c[letter] = not c[letter]
	for letter in alphabet:
		if c[letter]:
			print(letter)
			break


for i in range(int(input())):
	n = int(input())
	occurances = {}
	for z in range(2 * n):
		s = input()
		for x in s:
			if x in occurances:
				occurances[x] += 1
			else:
				occurances[x] = 1
	s = input()
	for ele in s:
		if ele in occurances:
			occurances[ele] += 1
	for x in occurances:
		if occurances[x] % 2 != 0:
			print(x)


import collections
t = int(input())
for tc in range(t):
	n = int(input())
	freq = {}
	for i in range(2 * n + 1):
		s = input()
		for ch in s:
			if ch not in freq:
				freq[ch] = 0
			freq[ch] += 1
	ans = ''
	for ch in freq:
		if freq[ch] % 2 == 1:
			ans = ch
			break
	print(ans)


import collections
import math
import sys
from queue import PriorityQueue
from random import randint
RANDOM = randint(1, 10 ** 9)

def main(testnumber):
	n = int(input())
	t = []
	for i in range(2 * n):
		t.append(input())
	s = input()
	cnt = collections.Counter(s + ''.join(t))
	for (k, v) in cnt.items():
		if v % 2 == 1:
			print(k)
t = int(input())
cnt = 1
while t > 0:
	main(cnt)
	cnt += 1
	t -= 1


from collections import defaultdict
t = int(input())
for _ in range(t):
	(n,) = map(int, input().split())
	d = defaultdict(int)
	for _ in range(2 * n + 1):
		x = input()
		for i in x:
			d[i] += 1
	for i in d:
		if d[i] & 1:
			print(i)
			break


import sys
nput = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	dat = {}
	for i in range(2 * n + 1):
		s = input()
		for j in s:
			if j in dat:
				dat[j] += 1
			else:
				dat[j] = 1
	for i in dat:
		if dat[i] % 2:
			print(i)
			break


from collections import defaultdict as DD
from collections import OrderedDict
from bisect import bisect_right
from heapq import heapify, heappush, heappop
from functools import lru_cache
import operator
MOD = 10 ** 9 + 7
MOD2 = 998244353
alice = 'Alice'
bob = 'Bob'
_T = 1

def pr(temp):
	print(temp)

def prnl(temp):
	for w in temp:
		pr(w)

def ri():
	temp = int(input())
	return temp

def rl():
	temp = list(map(int, input().split()))
	return temp

def zipList(*args):
	return list(zip(*args))

def sortMultiList(temp, *indices):
	return sorted(temp, key=operator.itemgetter(*indices))

def getSlice(temp, index):
	return [temp[i][index] for i in range(len(temp))]

def swap(array, ind1, ind2):
	temp = array[ind1]
	array[ind1] = array[ind2]
	array[ind2] = temp

def kvFromDict(_d):
	return [(k, v) for (k, v) in _d.items()]
from math import gcd

def lcm(a, b):
	return abs(a * b) // gcd(a, b)
from collections import Counter
from itertools import accumulate

def t_solution(t):
	for _ in range(t):
		solution()

def solution():
	n = ri()
	c = Counter()
	for _ in range(2 * n):
		s = input()
		for l in s:
			c[l] += 1
	final = input()
	for l in final:
		c[l] -= 1
	for k in c:
		if c[k] % 2:
			print(k)
			return
_T = ri()
t_solution(_T)


for t in range(int(input())):
	n = int(input())
	arr = []
	counts = {}
	for i in range(2 * n):
		arr.append(input())
	arr.append(input())
	for i in arr:
		for j in i:
			if j in counts:
				counts[j] = counts[j] + 1
			else:
				counts[j] = 1
	for i in counts:
		if counts[i] & 1:
			print(i)
			break


_ = int(input())
for __ in range(_):
	n = 2 * int(input()) + 1
	a = [0 for i in range(26)]
	for i in range(n):
		s = input()
		for c in s:
			a[ord(c) - ord('a')] += 1
	cnt = 0
	for i in range(26):
		if a[i] % 2 == 1:
			print(chr(i + ord('a')))
			cnt += 1
	if cnt != 1:
		print('fake problem')


t = int(input())
for i in range(t):
	n = 2 * int(input()) + 1
	a = [0 for i in range(26)]
	for i in range(n):
		z = input()
		for i in z:
			a[ord(i) - ord('a')] += 1
	for i in range(26):
		if a[i] % 2 == 1:
			print(chr(ord('a') + i))
			break


t = int(input())
for it in range(1, t + 1):
	d = {}
	for i in range(1, 2 * int(input()) + 1):
		s = input()
		for ok in s:
			if ok in d.keys():
				d[ok] += 1
			else:
				d[ok] = 1
	org = input()
	for ok in org:
		if ok in d.keys():
			d[ok] += 1
		else:
			d[ok] = 1
	for i in d.keys():
		if d[i] % 2 != 0:
			print(i)
			break


from collections import *
for _ in range(int(input())):
	n = int(input())
	z = Counter([])
	for i in range(2 * n):
		s = input()
		for i in s:
			z[i] += 1
	t = input()
	for i in t:
		z[i] += 1
	for i in z:
		if z[i] % 2:
			print(i)
			break


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	s_total = ''
	t = [''] * (2 * n)
	for i in range(2 * n):
		t[i] = input()
		s_total += t[i]
	s_final = input()
	s_total += s_final
	c = Counter(s_total)
	for key in c:
		if c[key] % 2 == 1:
			print(key)
			break


t = int(input())
for _ in range(t):
	n = int(input())
	S = set()
	for i in range(2 * n):
		s = str(input())
		for x in s:
			if x in S:
				S.remove(x)
			else:
				S.add(x)
	s = str(input())
	for x in s:
		if x in S:
			S.remove(x)
		else:
			S.add(x)
	print(S.pop())


T = int(input())
for _ in range(T):
	cnt = [0] * 26
	n = int(input())
	for i in range(n * 2):
		t = input()
		for c in t:
			cnt[ord(c) - ord('a')] ^= 1
	s = input()
	for c in s:
		cnt[ord(c) - ord('a')] ^= 1
	ans = None
	for i in range(26):
		if cnt[i] == 1:
			ans = chr(ord('a') + i)
			break
	print(ans)


for _ in range(int(input())):
	(n, m) = (int(input()), [0] * 30)
	for _ in range(n * 2 + 1):
		s = input()
		for x in s:
			m[ord(x) - ord('a')] += 1
	for i in range(30):
		if m[i] % 2 == 1:
			print(chr(i + ord('a')))


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [0 for _ in range(26)]
	for i in range(2 * n + 1):
		l = input()
		for c in l:
			arr[ord(c) - ord('a')] += 1
	for i in range(26):
		if arr[i] % 2 != 0:
			print(chr(i + ord('a')))
			break


for _ in range(int(input())):
	n = int(input())
	arr = []
	dp = {}
	for i in range(26):
		dp[i] = 0
	for i in range(2 * n):
		x = input()
		arr.append(x)
		for j in x:
			dp[ord(j) - 97] += 1
	s = input()
	for j in s:
		dp[ord(j) - 97] += 1
	for i in range(26):
		if dp[i] % 2 == 1:
			ans = i
			break
	print(chr(ans + 97))


t = int(input())
while t > 0:
	t -= 1
	dict = [0] * 26
	n = int(input())
	s = ''
	for i in range(2 * n + 1):
		s += input()
	for i in range(len(s)):
		dict[ord(s[i]) - 97] += 1
	for i in range(26):
		if dict[i] % 2 != 0:
			print(chr(i + 97))
			break


tc = int(input())
for t in range(tc):
	n = int(input())
	arr = [0] * 256
	for j in range(n):
		s = input()
		st = input()
		a = s + st
		for i in a:
			arr[ord(i)] += 1
	lst = input()
	for i in lst:
		arr[ord(i)] += 1
	for i in range(256):
		if arr[i] % 2 == 1:
			print(chr(i))
			break


t = int(input())
for _ in range(t):
	n = int(input())
	a = [0] * 26
	for j in range(2 * n + 1):
		s = input()
		for ch in s:
			a[ord(ch) - ord('a')] ^= 1
	print(chr(a.index(1) + ord('a')))


t = int(input())
for i in range(t):
	n = int(input())
	li = []
	for i in range(2 * n):
		s = input()
		li.append(s)
	s = input()
	d = dict()
	for i in s:
		if i in d:
			if d[i] == 0:
				d[i] = 1
			else:
				d[i] = 0
		else:
			d[i] = 1
	for i in range(2 * n):
		ns = li[i]
		for j in ns:
			if j in d:
				if d[j] == 0:
					d[j] = 1
				else:
					d[j] = 0
			else:
				d[j] = 1
	y = 0
	for i in d:
		if d[i] == 1:
			y = 1
			print(i)
			break
	if y == 0:
		print('a')


for _ in range(int(input())):
	n = int(input())
	l = [0] * 26
	for i in range(2 * n + 1):
		x = input()
		for i in x:
			p = ord(i) - ord('a')
			l[p] = (l[p] + 1) % 2
	for i in range(26):
		if l[i] == 1:
			print(chr(ord('a') + i))
			break


from collections import defaultdict
t = int(input())
for _ in range(t):
	n = int(input())
	t = []
	for i in range(2 * n):
		t.append(input())
	fs = input()
	ics = set()
	sall = ''
	for x in t:
		sall += x
		if len(x) == 1:
			ics.add(x)
	(dall, dfs) = (defaultdict(int), defaultdict(int))
	if len(ics) == 1:
		print(ics.pop())
	else:
		for x in sall:
			dall[x] += 1
		for x in fs:
			dfs[x] += 1
		for x in ics:
			if (dall[x] - dfs[x]) % 2 != 0:
				print(x)
				break


import sys
from os import path
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	n = int(input())
	n = n * 2 + 1
	dict = {}
	for i in range(n):
		s = input()
		for j in range(len(s)):
			if dict.get(s[j]) == None:
				dict[s[j]] = 1
			else:
				dict[s[j]] += 1
	for elem in dict:
		if dict[elem] % 2:
			print(elem)
			return
q = 1
q = int(input())
for i in range(q):
	solve()


t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	for _ in range(2 * n):
		s = input()
		l.append(s)
	p = input()
	k = ''.join(l)
	k += p
	d = dict()
	for i in range(len(k)):
		if k[i] not in d:
			d[k[i]] = 1
		elif d[k[i]] == 0:
			d[k[i]] += 1
		else:
			d[k[i]] -= 1
	f = ''
	for (k, v) in d.items():
		if v > 0:
			f += k * v
	print(f)


for _ in range(int(input())):
	n = int(input())
	ll = [0] * (2 * n)
	for i in range(2 * n):
		ll[i] = input()
	s = input()
	m = {}
	for i in range(len(s)):
		if s[i] in m:
			m[s[i]] += 1
		else:
			m[s[i]] = 1
	for i in range(2 * n):
		for j in range(len(ll[i])):
			if ll[i][j] in m:
				m[ll[i][j]] += 1
			else:
				m[ll[i][j]] = 1
	ans = 0
	for key in m:
		if m[key] % 2 != 0:
			ans = key
	print(ans)


T = int(input())
for i in range(0, T):
	n = int(input())
	a = [0] * 26
	for j in range(0, 2 * n + 1):
		temp = input()
		for k in temp:
			a[ord(k) - ord('a')] = (a[ord(k) - ord('a')] + 1) % 2
	for j in range(0, 26):
		if a[j] == 1:
			print(chr(j + ord('a')))
			break


t = int(input())
while t:
	n = int(input())
	l = [0] * 26
	for i in range(2 * n + 1):
		s = input()
		for j in range(len(s)):
			l[ord(s[j]) - 97] += 1
	for i in range(26):
		if l[i] % 2 == 1:
			print(chr(i + 97))
	t -= 1


import math
pow2 = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912]

def p2(x):
	return pow2[x]

def std(word):
	ans = 0
	for i in list(word):
		ans = ans ^ p2(ord(i) - 97)
	return ans
x = int(input())
for i in range(x):
	a = int(input())
	sets = 0
	for j in range(2 * a + 1):
		word = input()
		sets = std(word) ^ sets
	print(chr(97 + int(math.log(sets, 2))))


T = int(input())
for i in range(T):
	n = int(input())
	d = {}
	for j in range(2 * n):
		s = input()
		for k in range(len(s)):
			if s[k] not in d:
				d[s[k]] = 0
			d[s[k]] += 1
			d[s[k]] %= 2
	s = input()
	d1 = {}
	for j in range(len(s)):
		if s[j] not in d1:
			d1[s[j]] = 0
		d1[s[j]] += 1
		d1[s[j]] %= 2
	for key in d1:
		if d1[key] == 0:
			if key in d and d[key] == 1:
				ans = key
		elif key in d and d[key] == 0:
			ans = key
	for key in d:
		if key not in d1:
			if d[key] == 1:
				ans = key
	print(ans)


t = int(input())
for _ in range(t):
	letters = [[0, 0] for i in range(26)]
	n = int(input())
	for _ in range(2 * n + 1):
		s = input()
		if len(s) == 1:
			letters[ord(s) - ord('a')][1] = 1
		for c in s:
			letters[ord(c) - ord('a')][0] += 1
	for (i, l) in enumerate(letters):
		if l[1] == 1 and l[0] % 2 == 1:
			print(chr(ord('a') + i))
			break


from collections import defaultdict as dd
for _ in range(int(input())):
	n = int(input())
	l1 = []
	for x in range(2 * n):
		l1.append(input())
	l1.append(input())
	l2 = [0] * 26
	for x in range(2 * n + 1):
		for y in range(len(l1[x])):
			l2[ord(l1[x][y]) - 97] += 1
	for x in range(26):
		if l2[x] % 2 == 1:
			print(chr(97 + x))
			break


from collections import Counter as mset
for _ in range(int(input())):
	n = int(input())
	slot = mset()
	for _ in range(2 * n):
		slot.update(mset(input()))
	last = mset(input())
	ret = slot - last
	for (ch, c) in ret.items():
		if c & 1:
			print(ch)
			break


from collections import Counter

def solve(arr, x):
	d = Counter()
	for i in arr:
		d.update(Counter(i))
	d.update(Counter(x))
	for i in d:
		if d[i] % 2 == 1:
			return i
for _ in range(int(input())):
	n = int(input())
	arr = [list(input().strip()) for _ in range(2 * n)]
	x = input().strip()
	print(str(solve(arr, x)))


from sys import stdin, stdout
from collections import defaultdict, Counter
import threading

def solve(arr, x):
	d = Counter()
	for i in arr:
		d.update(Counter(i))
	d.update(Counter(x))
	for i in d:
		if d[i] % 2 == 1:
			return i
for _ in range(int(input())):
	n = int(input())
	arr = [list(input().strip()) for _ in range(2 * n)]
	x = input().strip()
	print(str(solve(arr, x)))


from collections import Counter
t = int(input())
for _ in range(t):
	n = int(input())
	c = Counter()
	for _ in range(2 * n):
		c += Counter(input())
	s = input()
	f = c - Counter(s)
	for x in f:
		if f[x] % 2:
			print(x)
			break