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

for _ in range(int(input())):
    s=input()
    k,n,m=map(int,input().split())
    a=list(map(int,input().split()))
    b=list(map(int,input().split()))
    ans=[]
    i=0
    j=0
    flag=1
    while(i<n and j<m):
        if(a[i]==0):
            ans.append(a[i])
            i+=1
            k+=1
        elif(b[j]==0):
            ans.append(b[j])
            j+=1
            k+=1
        elif(a[i]<b[j]):
            if(a[i]>k):
                flag=0
                break
            else:
                ans.append(a[i])
                i+=1
                k+=1
        else:
            if(b[j]>k):
                flag=0
                break
            else:
                ans.append(b[j])
                j+=1
                k+=1
    if(i==n):
        while(j<m):
            if(b[j]>k):
                flag=0
                break
            else:
                ans.append(b[j])
                j+=1
                k+=1
    else:
        while(i<n):
            if(a[i]>k):
                flag=0
                break
            else:
                ans.append(a[i])
                i+=1
                k+=1
    if(flag):
        print(*ans)
    else:
        print("-1")
