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

import sys
input=sys.stdin.readline
# sys.stdin=open('input.txt','r')

for _ in range(int(input())):
    xx=input()
    k,n,m=map(int,input().split())
    ar=list(map(int,input().split()))
    br=list(map(int,input().split()))
    
    flag=True
    i=0
    j=0
    ans=[]
    for ii in range(n+m):
        if(i<n and ar[i]==0):
            ans.append(0)
            k+=1
            i+=1
        elif(j<m and br[j]==0):
            ans.append(0)
            k+=1
            j+=1
        else:
            if(i<n and j<m):
                if(ar[i]<=br[j] and ar[i]<=k):
                    ans.append(ar[i])
                    i+=1
                    k+=1
                elif(ar[i]>br[j] and br[j]<=k):
                    ans.append(br[j])
                    j+=1
                    k+=1
                else:
                    flag=False
                    break
            elif(i<n and ar[i]<=k):
                ans.append(ar[i])
                i+=1
                k+=1
            elif(j<m and br[j]<=k):
                ans.append(br[j])
                j+=1
                k+=1
            else:
                flag=False
                break
    if(flag):
        print(*ans)
    else:
        print(-1)