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 = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    x, y = 0, 0
    z = 0
    o = []
    while x < n or y < m:
        if y == m or x < n and a[x] <= b[y]:
            o.append(a[x])
            x += 1
        else:
            o.append(b[y])
            y += 1
        if o[-1] == 0:
            k += 1
        elif o[-1] > k:
            print(-1)
            break
    else:
        print(' '.join(map(str, o)))