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())):
    space = input()
    k, n, m = map(int,input().split())
    mono = list(map(int,input().split()))
    poly = list(map(int,input().split()))
    i, j = 0,0
    res = []
    while i < n and j < m:
        if mono[i] > k and poly[j] > k:
            res = [-1]
            break
        else:
            if mono[i] == 0:
                k += 1
                res.append(mono[i])
                i += 1
            elif mono[i] <= k:
                res.append(mono[i])
                i += 1

            if poly[j] == 0:
                k += 1
                res.append(poly[j])
                j += 1
            elif poly[j] <= k:
                res.append(poly[j])
                j += 1
    while i < n:
        if mono[i] <= k:
            res.append(mono[i])
            i += 1
        else:
            res = [-1]
            break

    while j < m:
        if poly[j] <= k:
            res.append(poly[j])
            j += 1
        else:
            res = [-1]
            break

    print(*res)

