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

    #from _typeshed import SupportsKeysAndGetItem
import sys
#sys.stdin=open("input.txt","r");
#sys.stdout=open("output.txt","w")
####### GLOBAL ###############
MOD=1000000007
no=lambda:print("NO")
yes=lambda:print("YES")
_1=lambda:print(-1)
ari=lambda:[int(_) for _ in input().split()]
cin=lambda:int(input())
cis=lambda:input()
show=lambda x: print(x)
########### END #########
######
test_case=1
#test_case=input().split()
test_case=int(input())
######
def ans():
    lno,n,m=ari()
    mono=ari()
    poly=ari()
   # mono.sort()
   # poly.sort()
    ans=[]
    c=0
    if len(mono)>len(poly):
        c=1
    else:
        c=0
    #print(poly,mono)
    index=max(n,m)
    for i in range(max(n,m)):
        if  i<len(mono) and i<len(poly):
            first=mono[i]
            second=poly[i]
            if first==0:
                lno+=1
                ans.append(first)
                if second>lno:
                    _1()
                    return
                if second==0:
                    lno+=1
                ans.append(second)
            elif second==0:
                lno+=1
                ans.append(second)
                if first>lno:
                    _1()
                    return
                if first==0:
                    lno+=1
                ans.append(first)
            else:
                if second>lno or first>lno:
                    _1()
                    return
                ans.append(first)
                ans.append(second)
        else:
            index=i
            break
    if c==1:
        for it in range(index,len(mono)):
            if mono[it]==0:
                lno+=1
            if mono[it]>lno:
                _1()
                return
            ans.append(mono[it])
    else:
        for it in range(index,len(poly)):
            if poly[it]==0:
                lno+=1
            if poly[it]>lno:
                _1()
                return
            ans.append(poly[it])
            
    print(*ans)
        
    
    return
    
        
for _ in range(test_case):
    gar=input().split()
    ans()