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

import heapq


def Pairs(H, k, n, m):
    curr = k
    ans = []
    while len(H):
        x, y = heapq.heappop(H)
        if y == 0:
            curr += 1
            ans.append(y)
        else:
            if y > curr:
                print(-1)
                return
            else:
                ans.append(y)
    print(*ans)


t = int(input())
for _ in range(t):
    s = input()
    k, n, m = map(int, input().split())
    # (index, ai/bi)
    H = list()
    for x, y in enumerate(input().split()):
        heapq.heappush(H, (x, int(y)))
    for x, y in enumerate(input().split()):
        heapq.heappush(H, (x, int(y)))
    Pairs(H, k, n, m)