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

def solve():
    res = []
    s = input()
    lines_in_file, n, m = [int(e) for e in input().split()]
    f, sec = 0, 0
    first = [int(e) for e in input().split()]
    second = [int(e) for e in input().split()]
    for i in range(n + m):
        if f < n and first[f] == 0:
            lines_in_file += 1
            res.append(first[f])
            f += 1
        elif sec < m and second[sec] == 0:
            lines_in_file += 1
            res.append(second[sec])
            sec += 1
        elif f < n and first[f] > 0 and first[f] <= lines_in_file:
            res.append(first[f])
            f += 1
        elif sec < m and second[sec] > 0 and second[sec] <= lines_in_file:
            res.append(second[sec])
            sec += 1
        else:
            return [-1]
    return res


cases = int(input())
while cases > 0:
    cases -= 1
    print(*solve())