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

for _ in range(int(input())):
	s = input()
	
	k, n, m = map(int,input().split())
	
	a = list(map(int,input().split()))
	b = list(map(int,input().split()))
	
	i = 0
	j = 0
	f = 0
	ans=[]
	
	while i<n or j<m:
		if i==n:
			if b[j]!=0 and b[j]>k:
				print(-1)
				f=1
				break
			ans.append(b[j])
			j+=1
		
		elif j == m:
			if a[i]!=0 and a[i]>k:
				print(-1)
				f=1
				break
			ans.append(a[i])
			i+=1
			
		elif a[i] == 0:
			ans.append(a[i])
			i+=1
			k+=1
		elif b[j] == 0:
			ans.append(b[j])
			j+=1
			k+=1
			
		elif a[i]<=k:
			ans.append(a[i])
			i+=1
		elif b[j]<=k:
			ans.append(b[j])
			j+=1
		else:
			print(-1)
			f=1
			break
		
	if f:
		continue
	print(*ans)
