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

public class C {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader inp = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int t = Integer.parseInt(inp.readLine());
        while (t-- > 0) {
            inp.readLine();
            String[] knm = inp.readLine().trim().split(" ");
            int k = Integer.parseInt(knm[0]);
            int n = Integer.parseInt(knm[1]);
            int m = Integer.parseInt(knm[2]);
            String[] na = inp.readLine().trim().split(" ");
            String[] ma = inp.readLine().trim().split(" ");
            int[] nArr = new int[n];
            int[] mArr = new int[m];
            for (int i = 0; i < n; i++) {
                nArr[i] = Integer.parseInt(na[i]);
            }
            for (int i = 0; i < m; i++) {
                mArr[i] = Integer.parseInt(ma[i]);
            }
            Arrays.sort(nArr);
            Arrays.sort(mArr);
            int zeroLastN = -1, nonZeroStartN = n;
            int zeroLastM = -1, nonZeroStartM = m;
            for (int i = 0; i < n; i++) {
                if (nArr[i] != 0) {
                    zeroLastN = i - 1;
                    nonZeroStartN = i;
                    break;
                }
            }
            for (int i = 0; i < m; i++) {
                if (mArr[i] != 0) {
                    zeroLastM = i - 1;
                    nonZeroStartM = i;
                    break;
                }
            }
            boolean possible = true;
            int[] arr = new int[n + m];
            int i = 0;
            // (zeroLastN != -1 || zeroLastM != -1) || (nonZeroStartN != n || nonZeroStartM != m) || i < (n + m)
            while (true) {
                if (nonZeroStartN < n && nArr[nonZeroStartN] <= k && i < (n + m)) {
                    arr[i] = nArr[nonZeroStartN];
                    i++;
                    nonZeroStartN++;
                }
                if ((nonZeroStartM < m) && (mArr[nonZeroStartM] <= k) && i < (n + m)) {
                    arr[i] = mArr[nonZeroStartM];
                    i++;
                    nonZeroStartM++;
                }
                if (zeroLastN != -1 && i < (n + m)) {
                    arr[i] = 0;
                    i++;
                    zeroLastN--;
                    k++;
                    continue;
                }
                if (zeroLastM != -1 && i < (n + m)) {
                    arr[i] = 0;
                    i++;
                    zeroLastM--;
                    k++;
                    continue;
                }
                if ((zeroLastM == -1 || zeroLastN == -1) && i < (n + m)) {
                    possible = false;
                    break;
                }
                if (zeroLastN == -1 && zeroLastM == -1 && nonZeroStartN == n && nonZeroStartM == m) {
                    break;
                }
            }
            if (possible) {
                for (int j = 0; j < arr.length; j++) {
                    out.write(arr[j] + " ");
                }
            } else {
                out.write("-1");
            }
            out.write("\n");
            out.flush();
        }
    }
}