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())):
    p = input()
    t,a,b = map(int,input().split(" "))
    # p = t
    arr = []
    arr.append(list(map(int,input().split(" "))))
    arr.append(list(map(int,input().split(" "))))
    ptar = []
    for x in range(a+b):
        if arr[0] and arr[0][0]<=t:
            ptar.append(arr[0][0])
            if arr[0][0]==0:
                t+=1
            arr[0].pop(0)
        elif arr[1] and arr[1][0]<=t:
            ptar.append(arr[1][0])
            if arr[1][0]==0:
                t+=1
            arr[1].pop(0)
        else:
            ptar=[-1]
            break
    print(*ptar)
            

