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

/**
 *
 * @author Acer
 */
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();
            ArrayList<Integer> zero = new ArrayList<Integer>();
            ArrayList<Integer> arr = new ArrayList<Integer>();
            for (int i = 0; i < n; i++) {
                int x = sc.nextInt();
                if(x == 0){
                   zero.add(x);
                }
                else{
                    arr.add(x);
                }
            }
            
            for (int i = 0; i < m; i++) {
                int x = sc.nextInt();
                if(x == 0){
                   zero.add(x);
                }
                else{
                    arr.add(x);
                }
            }
            
            
            boolean flag = true;
            for (int i = 0; i < arr.size(); i++) {
                if(arr.get(i) > k+zero.size()){
                    flag = false;
                    break;
                }
            }
            
            if(flag){
                int ln = Math.max(zero.size(), arr.size());
                Collections.sort(arr);
                for (int i = 0; i < ln; i++) {
                    if(i < zero.size()){
                        System.out.print(zero.get(i)+" ");
                    }

                    if(i < arr.size()){
                        System.out.print(arr.get(i)+" ");
                    }
                }
                System.out.println();
            }
            else{
                System.out.println(-1);
            }
        }
    }
    
}