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

from __future__ import division,print_function
from heapq import*
import sys
le = sys.__stdin__.read().split("\n")[::-1]
af=[]
for zorg in range(int(le.pop())):
    le.pop()

    def f():
        k,n,m= list(map(int,le.pop().split()))
        a=list(map(int,le.pop().split()))
        b=list(map(int,le.pop().split()))
        ac=[]
        ia,ib=0,0
        for i in range(n+m):
            if ia<n and a[ia]<=k:
                ac.append(a[ia])
                if a[ia]==0:
                    k+=1
                ia+=1
            elif ib<m and b[ib]<=k:
                ac.append(b[ib])
                if b[ib]==0:
                    k+=1
                ib+=1
            else:
                return -1
        return " ".join(map(str,ac))        
    af.append(f())
print("\n".join(map(str,af)))
