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):
    dummy = input()
    k, m , n = list(map(int,input().rstrip().split()))
    arrm = list(map(int,input().rstrip().split()))
    arrn = list(map(int,input().rstrip().split()))
    final = []
    pm = 0
    pn = 0
    count=0
    while pm < m or pn < n:
        if pm < m and arrm[pm] == 0:
            final.append(arrm[pm])
            pm+=1
            k+=1
        elif pn < n and  arrn[pn] == 0:
            final.append(arrn[pn])
            pn+=1
            k+=1
        else:
            if pm < m and arrm[pm] <= k:
                final.append(arrm[pm])
                pm+=1
            elif pn < n and arrn[pn] <= k:
                final.append(arrn[pn])
                pn+=1
            else:
                break
    if pm < m or pn < n:
        print(-1)
    else:
        print(*final)
    

            