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())
while t:
    t -= 1
    input()
    k, n, m = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    run_len = k
    ai, bi = 0, 0
    seq = []
    while ai < len(a) and bi < len(b):
        if a[ai] == 0:
            seq.append(0)
            ai += 1
            run_len += 1
            continue

        if b[bi] == 0:
            seq.append(0)
            bi += 1
            run_len += 1
            continue
            
        if a[ai] > run_len and b[bi] > run_len:
            seq = []
            break
            
        if a[ai] < b[bi]:
            seq.append(a[ai])
            ai += 1
        else:
            seq.append(b[bi])
            bi += 1
    
    while ai < len(a):
        if a[ai] == 0:
            seq.append(0)
            ai += 1
            run_len += 1
        elif a[ai] > run_len:
            seq = []
            break
        else:
            seq.append(a[ai])
            ai += 1
        
    while bi < len(b):
        if b[bi] == 0:
            seq.append(0)
            bi += 1
            run_len += 1
        elif b[bi] > run_len:
            seq = []
            break
        else:
            seq.append(b[bi])
            bi += 1

    if seq:
        print(' '.join(str(x) for x in seq))
    else:
        print(-1)
        