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

import sys
LI=lambda:list(map(int,sys.stdin.readline().split()))
MI=lambda:map(int,sys.stdin.readline().split())
SI=lambda:sys.stdin.readline().strip('\n')
II=lambda:int(sys.stdin.readline())
from collections import deque
for _ in range(II()):
	input()
	k, n, m=MI()
	a, b=deque(LI()), deque(LI())
	r=[]
	ok=1
	while a or b:
		# print(a, b)
		if a and a[0]==0:
			r.append(0)
			a.popleft()
		elif b and b[0]==0:
			r.append(0)
			b.popleft()
		else:
			if a and a[0]<=len(r)+k:
				r.append(a[0])
				a.popleft()
			elif b and b[0]<=len(r)+k:
				r.append(b[0])
				b.popleft()
			else:
				ok=0
				break
	if ok:print(*r)
	else:print(-1)