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 t in range(T):
    input();
    [k,n,m]=list(map(int,input().split()));
    a=list(map(int,input().split()));
    b=list(map(int,input().split()));
    
    
    l=a.count(0)+b.count(0);
    k+=l;
    if(k<max(a) or k<max(b)):print(-1);
    else:
        c=[0]*l;
        for i in range(n):
            if(a[i]!=0):c.append(a[i]);
        for i in range(m):
            if(b[i]!=0):c.append(b[i]);
        print(*c);
        
        
        
        
        
    