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

t = int(input())

for _ in range(t):
    random = input()
    k, n, m = [int(i) for i in input().split(' ')]
    an = [int(i) for i in input().split(' ')]
    am = [int(i) for i in input().split(' ')]
    i = j = 0
    sol = []
    while True:
        if i < n and an[i] <= k:
            if an[i] == 0:
                k += 1
            sol.append(an[i])
            i += 1
        elif j < m and am[j] <= k:
            if am[j] == 0:
                k += 1
            sol.append(am[j])
            j += 1
        else:
            break
    if i < n or j < m:
        sol = [-1]
    for i in sol:
        print(i, end=' ')
    print()
