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

from collections import deque
for _ in range(int(input())):
    blank = input()
    k, n, m = map(int, input().split())
    a = deque(map(int, input().split()))
    b = deque(map(int, input().split()))

    ans = []
    fail = False

    while a and b:
        next_a = a[0]
        next_b = b[0]

        if next_a == 0:
            ans.append(0)
            k += 1
            a.popleft()
        elif next_b == 0:
            ans.append(0)
            k += 1
            b.popleft()
        elif next_a <= next_b:
            if next_a <= k:
                ans.append(next_a)
                a.popleft()
            else:
                fail = True
                break
        else:
            if next_b <= k:
                ans.append(next_b)
                b.popleft()
            else:
                fail = True
                break
    else:
        while a:
            next_a = a[0]
            if next_a == 0:
                ans.append(0)
                k += 1
                a.popleft()
            else:
                if next_a <= k:
                    ans.append(next_a)
                    a.popleft()
                else:
                    fail = True
                    break

        while b:
            next_b = b[0]
            if next_b == 0:
                ans.append(0)
                k += 1
                b.popleft()
            else:
                if next_b <= k:
                    ans.append(next_b)
                    b.popleft()
                else:
                    fail = True
                    break
    if not fail:
        print(*ans)
    else:
        print(-1)