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 math import *
from sys import *
input=stdin.readline

# map(int,input().split())

for _ in range(int(input())):
    input()
    k,n,m=map(int,input().split())
    a=list(map(int,input().split()))
    b=list(map(int,input().split()))
    i=0;j=0;l=[];cnt=1
    while (i<n) or (j<m):
        if i<n and a[i]==0:
            l.append(a[i])
            i+=1
            k+=1
            continue
        if j<m and b[j]==0:
            l.append(b[j])
            j+=1
            k+=1
            continue
        if i<n and k>=a[i]:
            l.append(a[i])
            i+=1
        elif j<m and k>=b[j]:
            l.append(b[j])
            j+=1
        else:
            cnt=0
            break
    if cnt:
        print(*l)
    else:print(-1)