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())):
    input()
    k, n, m = [int(i) for i in input().split()]
    a = [int(i) for i in input().split()]
    b = [int(i) for i in input().split()]
    arr_0 = []
    arr_other = []
    for i in a:
        if i == 0:
            arr_0.append(i)
        else:
            arr_other.append(i)
    for i in b:
        if i == 0:
            arr_0.append(i)
        else:
            arr_other.append(i)
    q_str = k + len(arr_0)
    f = True
    for i in arr_other:
        if i > q_str:
            f = False
            break
    if f:
        print(*arr_0, *arr_other)
    else:
        print(-1)