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())):
    input()
    k,n,m=map(int,input().split())
    a1=list(map(int,input().split()))
    a2=list(map(int,input().split()))
    c1=a1.count(0)
    c2=a2.count(0)
    maxm=k+c1+c2
    ans=None
    b1,b2=[],[]
    for i in range(n):
        if a1[i]>maxm:
            ans=-1
            break
        if a1[i]:
            b1.append(a1[i])
    for i in range(m):
        if a2[i]>maxm:
            ans=-1
            break
        if a2[i]:
            b2.append(a2[i])
    if ans==-1:
        print(ans)
    else:
        ans=[0]*(c1+c2)
        x,y=len(b1),len(b2)
        l,r=0,0
        while l<x and r<y:
            if b1[l]<b2[r]:
                ans.append(b1[l])
                l+=1
            else:
                ans.append(b2[r])
                r+=1
        while l<x:
            ans.append(b1[l])
            l+=1
        while r<y:
            ans.append(b2[r])
            r += 1
        for i in range(m+n):
            print(ans[i],end=" ")
        print()