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())):
  n=input()
  k,n,m=map(int,input().split())
  x=list(map(int,input().split()))
  y=list(map(int,input().split()))
  i=0
  j = 0
  ans=[]
  while True:
    if i<n and x[i]<=k:
      if x[i]==0:
        k+=1
      ans.append(x[i])
      i+=1
    elif j<m and y[j]<=k:
      if y[j]==0:
        k+=1
      ans.append(y[j])
      j+=1
    else:
      break
  
  if i<n or j<m:
    ans=[-1]
for i in ans:
  print(i, end = ' ')