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

t=int(input())

for i in range(t):
    _=input()
    k,n,m=map(int,input().split())
    i=0
    j=0
    res=[]

    arr1=list(map(int,input().split()))
    arr2=list(map(int,input().split()))

    while i<len(arr1) or j<len(arr2):
        if i<len(arr1) and j<len(arr2):
            if arr1[i]==0:
                k+=1
                i+=1
                res.append(0)
            elif arr2[j]==0:
                k+=1
                j+=1
                res.append(0)
            elif arr1[i]<arr2[j]:
                if arr1[i]>k:
                    res=[-1]
                    break
                else:
                    res.append(arr1[i])
                    i+=1
            else:
                if arr2[j]>k:
                    res=[-1]
                    break
                else:
                    res.append(arr2[j])
                    j+=1
        
        elif j<len(arr2):
            if arr2[j]>k:
                    res=[-1]
                    break
            else:
                res.append(arr2[j])
                j+=1

        else:
            if arr1[i]>k:
                    res=[-1]
                    break
            else:
                res.append(arr1[i])
                i+=1
        
        #print(i,j)
        

    print(*res)

