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):
    s=input()
    k,n,m=map(int,input().split())

    a=list(map(int,input().split()))

    b=list(map(int,input().split()))
    p=0
    q=0
    l=[]
    f=1
    while p<n and q<m:
        if a[p]==0:
            k=k+1
            p=p+1
            l.append(0)
        elif b[q]==0 :
            k=k+1
            q=q+1
            l.append(0)
        elif k>=a[p] :
            l.append(a[p])
            p=p+1
        elif k>=b[q] :
            l.append(b[q])
            q=q+1
        else:
            f=0
            break
    if p==n and f:
        while q<m:
            if b[q] == 0:
                k = k + 1
                q = q + 1
            elif k >= b[q]:
                l.append(b[q])
                q = q + 1
            else:
                f = 0
                break
    elif q==m and f:
        while p<n:
            if a[p] == 0:
                k = k + 1
                p = p + 1
            elif k >= a[p]:
                l.append(a[p])
                p = p + 1
            else:
                f = 0
                break

    if f==0:
        print(-1)
    else:
        print(*l,end=" ")
    print()



