5

3 2 2
2 0
0 5

4 3 2
2 0 5
0 6

0 2 2
1 0
2 3

5 4 4
6 0 8 0
0 7 0 9

5 4 1
8 7 8 0
0

0 2 0 5
0 2 0 5 6
-1
0 6 0 7 0 8 0 9
-1

I=lambda: map(int, raw_input().split())
t = input()
for _ in xrange(t):
	raw_input()
	k,n,m = I()
	a = I()
	b = I()
	ok = True
	rLst = []
	i = j = 0
	while i<n or j<m:
		if i<n and j<m:
			if a[i] <= b[j]:
				if a[i] > k:
					ok = False
					break
				if a[i]==0:
					k += 1
				rLst.append(str(a[i]))
				i += 1
			else:
				if b[j] > k:
					ok = False
					break
				if b[j]==0:
					k += 1
				rLst.append(str(b[j]))
				j += 1
		elif i<n:
			if a[i] > k:
				ok = False
				break
			if a[i]==0:
				k += 1
			rLst.append(str(a[i]))
			i += 1
		elif j<m:
			if b[j] > k:
				ok = False
				break
			if b[j]==0:
				k += 1
			rLst.append(str(b[j]))
			j += 1
	if not ok:
		print -1
	else:
		print ' '.join(rLst)