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 t in range(int(input())):
    res = True
    seq = []
    input()
    k, n, m = map(int , input().split())
    lst_n = list(map(int, input().split()))
    lst_m = list(map(int, input().split()))
    for i in range(n+m):
        if len(lst_n) > 0:
            if lst_n[0] > k:
                if len(lst_m) > 0:
                    if lst_m[0] == 0:
                        k+=1
                        seq.append(lst_m[0])
                        lst_m.pop(0)
                    elif lst_m[0] <= k:
                        seq.append(lst_m[0])
                        lst_m.pop(0)
                    else:
                        res = False
                        break
                else:
                    res = False
                    break
            elif lst_n[0] == 0:
                k += 1
                seq.append(lst_n[0])
                lst_n.pop(0)
            elif lst_n[0] <= k:
                seq.append(lst_n[0])
                lst_n.pop(0)
    if len(lst_m) > 0:
        for l in lst_m:
            if l <= k:
                seq.append(l)
            else:
                res = False
                break
    
    if res:
        for s in seq:
            print(s,"", end="")
        print()
    else: print(-1)

