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

public class Main {
    public static final void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        for (int z = 0; z < t; z++) {
            int k = in.nextInt();
            int n = in.nextInt();
            int m = in.nextInt();
            int[] mono = new int[n];
            int[] poly = new int[m];
            int[] ans = new int[n + m];
            for (int i = 0; i < n; i++) {
                mono[i] = in.nextInt();
            }
            for (int i = 0; i < m; i++) {
                poly[i] = in.nextInt();
            }
            int i = 0, j = 0, fl = 0;
            boolean tf = true;
            int t1=0, t2=0;
            while (i < n || j < m) {
                if (i < n) {
                    if (mono[i] <= k) {
                        ans[fl] = mono[i];
                        fl++;
                        if (mono[i] == 0)
                            k++;
                        i++;
                        t1 = 0;
                    } else {
                        t1++;
                    }
                }
                if (j < m) {
                    if (poly[j] <= k) {
                        ans[fl] = poly[j];
                        fl++;
                        if (poly[j] == 0)
                            k++;
                        j++;
                        t2 = 0;
                    } else {
                        t2++;
                    }
                }
                if (t1 > 3 || t2 > 3) {
                    tf = false;
                    break;
                }
            }
            if (tf) {
                for (int ii = 0; ii < n + m; ii++) {
                    System.out.print(ans[ii] + " ");
                }
                System.out.println();
            } else
                System.out.println(-1);
        }
    }
}