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<n or j<m:
        if i<n and arr1[i]==0:
            k+=1
            i+=1
            res.append(0)
        
        elif j<m and arr2[j]==0:
            k+=1
            j+=1
            res.append(0)
        
        elif i<n and arr1[i]<=k:
            res.append(arr1[i])
            i+=1
        
        elif j<m and arr2[j]<=k:
            res.append(arr2[j])
            j+=1
        
        else:
            res=[-1]
            break
    
    print(*res)

