Chef has three baskets and two of them have multiple balls(Natural numbers written on them). The first basket has N balls, the second basket has M balls and the third basket is empty. Chef starts choosing all the unique balls(only occurring once in both the baskets) and puts into the third basket and throw the repetitive ones. Print numbers on the balls of the third basket in ascending order. 

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- Each testcase contains three lines of input.
- First-line has two integers $N, M$. 
- Second-line with N space-separated numbers.
- Third-line with M space-separated numbers.

-----Output:-----
For each testcase, output in a single line answer.

-----Constraints-----
- $1 \leq T \leq 10$
- $1 \leq N \leq 10^5$
- $1 \leq M \leq 10^5$

-----Sample Input:-----
1
4 5
1 2 3 4
2 3 4 5 6

-----Sample Output:-----
1 5 6

Source: codechef | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	arr1 = list(map(int, input().split()))
	arr2 = list(map(int, input().split()))
	hmap = {}
	for i in range(n):
		if arr1[i] in hmap:
			hmap[arr1[i]] += 1
		else:
			hmap[arr1[i]] = 1
	for i in range(m):
		if arr2[i] in hmap:
			hmap[arr2[i]] += 1
		else:
			hmap[arr2[i]] = 1
	ans = []
	for key in hmap:
		if hmap[key] == 1:
			ans.append(key)
	ans.sort()
	for x in ans:
		print(x, end=' ')
	print()


for _ in range(int(input())):
	(lenn, lenm) = [int(x) for x in input().split()]
	n = [int(x) for x in input().split()]
	m = [int(x) for x in input().split()]
	answer = set(n) ^ set(m)
	print(*list(answer))


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
for _ in range(ii()):
	(n, m) = mi()
	arr = lii()
	brr = lii()
	arr.extend(brr)
	arr.sort()
	d = dd(int)
	for ele in arr:
		d[ele] += 1
	for ele in d:
		if d[ele] == 1:
			print(ele, end=' ')
	print()


t = int(input())
while t:
	(m, n) = map(int, input().split())
	arr = [int(i) for i in input().split()]
	brr = [int(i) for i in input().split()]
	d = {}
	for i in arr:
		if i not in d:
			d[i] = 1
		else:
			d[i] += 1
	for i in brr:
		if i not in d:
			d[i] = 1
		else:
			d[i] += 1
	z = []
	for i in d:
		if d[i] == 1:
			z.append(i)
	z.sort()
	print(*z)
	t -= 1


import sys, io, os, math
from math import ceil, log, gcd, inf
from itertools import permutations
mod = 1000000007
mod1 = 998244353

def printlist(n):
	sys.stdout.write(' '.join(map(str, n)) + '\n')
printf = lambda n: sys.stdout.write(str(n) + '\n')

def printns(n):
	sys.stdout.write(str(n))

def intinp():
	return int(sys.stdin.readline())

def strinp():
	return sys.stdin.readline()

def arrinp():
	return list(map(int, sys.stdin.readline().strip().split()))

def mulinp():
	return map(int, sys.stdin.readline().strip().split())

def flush():
	return sys.stdout.flush()

def power_two(x):
	return 1 << x

def lcm(a, b):
	return a * b // gcd(a, b)

def solve():
	(n, m) = mulinp()
	t = set(arrinp())
	t2 = set(arrinp())
	temp = t.difference(t2)
	temp1 = t2.difference(t)
	ans = temp.union(temp1)
	for i in ans:
		print(i, end=' ')
	print()

def main():
	tc = intinp()
	while tc:
		solve()
		tc -= 1
main()


T = int(input())
for t in range(T):
	z = input()
	(N, M) = z.split()
	(N, M) = (int(N), int(M))
	z = input()
	first = z.split()
	second = input().split()
	first = [int(i) for i in first]
	second = [int(i) for i in second]
	set_1 = set()
	set_2 = set()
	for i in first:
		if i not in set_1:
			set_1.add(i)
	for i in second:
		if i not in set_2:
			set_2.add(i)
	output = []
	for i in first:
		if i not in set_2:
			output.append(i)
	for i in second:
		if i not in set_1:
			output.append(i)
	for i in output:
		print(i, end=' ')


t = int(input())
for i in range(0, t):
	(n, m) = list(map(int, input().split()))
	list1 = []
	arr1 = list(map(int, input().split()))[:n]
	arr2 = list(map(int, input().split()))[:m]
	res = list(set(arr2) ^ set(arr1))
	print(*res)


for _ in range(int(input())):
	(n, m) = [int(x) for x in input().split()]
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	x = a + b
	dp = [0] * (max(x) + 1)
	for _ in range(len(x)):
		dp[x[_]] += 1
	for _ in range(1, len(dp)):
		if dp[_] == 1:
			print(_, end=' ')
	print()


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	x = []
	l = set(map(int, input().split()))
	l2 = set(map(int, input().split()))
	for i in l:
		if i not in l2:
			x.append(i)
	for i in l2:
		if i not in l:
			x.append(i)
	x.sort()
	for i in x:
		print(i, end=' ')
	print()


from collections import Counter
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	ar = list(map(int, input().split()))
	br = list(map(int, input().split()))
	cr = ar + br
	cr = Counter(cr)
	dr = []
	for i in cr:
		if cr[i] == 1:
			dr.append(i)
	dr.sort()
	print(*dr)


def CountFrequency(my_list):
	freq = {}
	vec = []
	for item in my_list:
		if item in freq:
			freq[item] += 1
		else:
			freq[item] = 1
	for (key, value) in list(freq.items()):
		if value == 1:
			vec.append(key)
	vec.sort()
	return vec
t = int(input())
for i in range(0, t):
	(n, m) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = a + b
	ll = CountFrequency(c)
	print(*ll)


t = int(input())
for _ in range(t):
	(m, n) = map(int, input().strip().split())
	x = list(map(int, input().split()))
	f = list(map(int, input().split()))
	print(*(set(x) | set(f)) - (set(x) & set(f)))


t = int(input())
for _ in range(t):
	(m, n) = map(int, input().strip().split())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a = set(a)
	b = set(b)
	z = b - a
	y = a - b
	print(*y, *z)


t = int(input())
while t > 0:
	(n, m) = map(int, input().split())
	list_n = list(map(int, input().split()))
	list_m = list(map(int, input().split()))
	set_m = set(list_m)
	set_n = set(list_n)
	set_mn = set_m - set_n
	set_nm = set_n - set_m
	union_set = set_mn.union(set_nm)
	print(*sorted(list(union_set)))
	t -= 1


def f(N, M):
	setn = set()
	setrn = set()
	for ele in N + M:
		if ele in setrn:
			continue
		elif ele in setn:
			setn.remove(ele)
			setrn.add(ele)
		else:
			setn.add(ele)
	return list(setn)
t = int(input())
answers = list()
for _ in range(t):
	some_inp = input()
	N = list(map(int, input().split()))
	M = list(map(int, input().split()))
	answers.append(f(N, M))
for answer in answers:
	print(*answer, sep=' ')


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	arr1 = [int(x) for x in input().split()]
	arr2 = [int(x) for x in input().split()]
	s1 = set(arr1)
	s2 = set(arr2)
	l = []
	for i in arr1:
		if i not in s2:
			l.append(i)
	for i in arr2:
		if i not in s1:
			l.append(i)
	l.sort()
	print(*l)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	c = list(map(int, input().split()))
	d = list(map(int, input().split()))
	h = dict()
	for i in c:
		h[i] = h.get(i, 0) + 1
	for i in d:
		h[i] = h.get(i, 0) + 1
	k = list()
	for (i, j) in h.items():
		if j == 1:
			k.append(i)
	k.sort()
	for i in k:
		print(i, end=' ')
	print()


t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	sa = set(a)
	sb = set(b)
	ans = set()
	for i in sa:
		if i not in sb:
			ans.add(i)
	for i in sb:
		if i not in sa:
			ans.add(i)
	print(*sorted(ans))


n = int(input())
res = []
for _ in range(n):
	m = input().split()
	ls1 = list(map(int, input().strip().split()))
	ls2 = list(map(int, input().strip().split()))
	ls1 = set(ls1)
	ls2 = set(ls2)
	c = ls1.intersection(ls2)
	ls1 = list(ls1)
	ls2 = list(ls2)
	for ele in c:
		ls1.remove(ele)
		ls2.remove(ele)
	ls1.extend(ls2)
	ls1.sort()
	for ele in ls1:
		print(ele, end=' ')


T = int(input())
for _ in range(T):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	a.sort()
	b.sort()
	(i, j) = (0, 0)
	l = []
	while i < n and j < m:
		if a[i] < b[j]:
			l.append(a[i])
			i += 1
		elif a[i] == b[j]:
			i += 1
			j += 1
		else:
			l.append(b[j])
			j += 1
	while i < n:
		l.append(a[i])
		i += 1
	while j < m:
		l.append(b[j])
		j += 1
	print(*l)


import sys
from math import log2
from itertools import combinations
for _ in range(int(sys.stdin.readline())):
	(n, m) = list(map(int, sys.stdin.readline().split()))
	a = set(map(int, sys.stdin.readline().split()))
	b = set(map(int, sys.stdin.readline().split()))
	c = []
	for i in a:
		if i not in b:
			c.append(i)
	for i in b:
		if i not in a:
			c.append(i)
	c = list(set(c))
	c.sort()
	print(*c)


testcases = int(input())
for x in range(testcases):
	(n, m) = map(int, input().split())
	fb = list(map(int, input().split()))
	sb = list(map(int, input().split()))
	print(*sorted(list(set(fb) ^ set(sb))))


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	arr = set(map(int, input().split()))
	brr = set(map(int, input().split()))
	a = arr ^ brr
	for i in a:
		print(i, end=' ')