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.*;
import java.io.*;

public class test {

    public static void solve(int k, int n, int a[], int m, int[] b) {
        int zeros = 0;
        for(int i : a) {
            if(i == 0)
                zeros++;
        }
        for(int i : b) {
            if(i == 0) {
                zeros++;
            }
        }
        int max = (int)Math.max(max(a),max(b));
        if(max > (k + zeros)) {
            System.out.println(-1);
            return;
        }
        Arrays.sort(a);
        Arrays.sort(b);
        ArrayList<Integer> notadded = new ArrayList<>();
        int zeros1 =0;
        int zeros2 = 0;
        for(int i : a) {
            if(i == 0) {
                zeros1++;
                System.out.print(i+ " ");
            }
            else if(i > (zeros1 + n)) {
                notadded.add(i);
            }
            else {
                System.out.print(i+" ");
            }
        }
        for(int i : b) {
            if(i == 0) {
                zeros2++;
                System.out.print(i+ " ");
            }
            else if(i > (zeros2 + m)) {
                notadded.add(i);
            }
            else {
                System.out.print(i+" ");
            }
        }
        if(!notadded.isEmpty()) {
            for(Integer i: notadded) {
                System.out.print(i + " ");
            }
        }
        System.out.println();
    }

    public static int max(int[] a) {
        int max = Integer.MIN_VALUE;
        for(int i : a) {
            if(i > max) {
                max = i;
            }
        }
        return max;
    }
   

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        long t = Long.parseLong(br.readLine());
        while(t-- > 0) {
            String temp = br.readLine();
            String[] sin = br.readLine().split(" ");
            int k = Integer.parseInt(sin[0]);
            int n = Integer.parseInt(sin[1]);
            int m = Integer.parseInt(sin[2]);

            String[] sin1 = br.readLine().split(" ");
            int[] a = new int[n];
            for(int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(sin1[i]);
            }

            String[] sin2 = br.readLine().split(" ");
            int[] b = new int[m];
            for(int i = 0; i < m; i++) {
                b[i] = Integer.parseInt(sin2[i]);
            }
            solve(k, n, a, m, b);
        }
    }

    public static long gcd(long a, long b) {
        if(b == 0) {
            return a;
        }
        else {
            return gcd(b, a % b);
        }
    }

    public static long LCM(long a, long b) {
        return Math.abs(a*b) / gcd(a, b);
    }
}
