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 True:
        if p<n and a[p]<=k:
            if a[p]==0:
                k=k+1
            l.append(a[p])
            p=p+1
        elif q<m and b[q]<=k:
            if b[q]==0:
                k=k+1
            l.append(b[q])
            q=q+1
        else:
            break
    if p<n or q<m:
        print(-1)
    else:
        print(*l,end=" ")
    print()