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 sys
def ints():
    return list(map(int, sys.stdin.readline().strip().split()))
tc = int(input())
while tc:
    tc-=1
    s = input()
    k, n, m = map(int, input().split())
    ln = ints()
    lm = ints()
    op = []
    i, j = 0, 0
    while i<n and j<m:
        if ln[i] < lm[j]:
            op.append(ln[i])
            i += 1
        else:
            op.append(lm[j])
            j += 1
    while i<n:
        op.append(ln[i])
        i += 1
    while j<m:
        op.append(lm[j])
        j += 1
    flag = 0
    for item in op:
        if item == 0:
            k+=1
        elif item <= k:
            pass
        else:
            flag = 1
    if flag:
        print(-1)
    else:
        print(*op)