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

def fun3(k):
   flag=False
   while h:
      x=h.pop(0)
      if x==0:
         k+=1
         re.append(x)
      elif x<=k:
         re.append(x)
      else:
         flag=True
         break
   return flag
def fun2(k):
   flag=False
   while j:
      x=j.pop(0)
      if x==0:
         k+=1
         re.append(x)
      elif x<=k:
         re.append(x)
      else:
         flag=True
         break
   return flag
t=int(input())
while t:
   tem=input()
   t-=1
   k,n,m = map(int, input().split())
   j = list(map(int, input().split()))
   h = list(map(int, input().split()))
   re=[]
   flag=False
   while j and h:
      x=min(j[0],h[0])
      if j[0]<=h[0]:
         j.pop(0)
      else:
         h.pop(0)
      if x==0:
         k+=1
         re.append(x)
      elif x<=k:
         re.append(x)
      else:
         flag=True
         break
   if flag:
      print(-1)
   else:
      flag=fun2(k)
      if flag:
         print(-1)
      else:
         flag=fun3(k)
         if flag:
            print(-1)
         else:
            print(*re)