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 java.util.Scanner;

public class PairProgramming {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while (t-->0){
            int k=sc.nextInt();
            int n=sc.nextInt();
            int m=sc.nextInt();
            int a[]=new int[n];
            int b[]=new int[m];
            int c1=0,c2=0;
            boolean f=true;
            for (int i = 0; i < n; i++) {
                a[i]=sc.nextInt();
                if(a[i]==0){
                    ++c1;
                }
            }
            for (int i = 0; i < m; i++) {
                b[i]=sc.nextInt();
                if(b[i]==0){
                    ++c2;
                }
            }
            k+=c1;
            k+=c2;
            for (int i = 0; i < n; i++) {
                if(a[i]>k){
                    System.out.println(-1);
                    f=false;
                    break;
                }
            }
            for (int i = 0; i < m; i++) {
                if(b[i]>k){
                    System.out.println(-1);
                    f=false;
                    break;
                }
            }
if(f){
            for (int i = 0; i < c1+c2; i++) {
                System.out.print(0+" ");
            }
            for (int i = 0; i < n; i++) {
                if(a[i]!=0){
                    System.out.print(a[i]+" ");
                }
            }
            for (int i = 0; i < m; i++) {
                if(b[i]!=0){
                    System.out.print(b[i]+" ");
                }
            }
            System.out.println();
        }
    }}
}
