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.*;

public class PairProgramming {

	public static List<Integer> findSeq(int [] mono, int [] poly, int k) {
		int i = 0;
		int j = 0;
		int count = k;
		boolean isOk = true;
		List<Integer> result = new ArrayList<>(mono.length + poly.length);
		int index = 0;
		while (i < mono.length || j < poly.length) {
			if (i != mono.length && mono[i] == 0) {
				result.add(mono[i++]);
				count ++;
			}
			else if (j != poly.length && poly[i] == 0) {
				result.add(poly[j++]);
				count ++;
			}
			else if (i != mono.length && mono[i] <= count) {
				result.add(mono[i++]);
			}
			else if (j != poly.length && poly[i] <= count) {
				result.add(poly[j++]);
			}
			else {
				isOk = false;
				break;
			}
		}
		if (!isOk) {
			result.clear();
			result.add(-1);
			return result;
		} 
		return result;
	}

	public static void main(String [] args) {
		Scanner sc = new Scanner(System.in);
		int test = sc.nextInt();
		while (test-- > 0) {
			int k = sc.nextInt();
			int n = sc.nextInt();
			int m = sc.nextInt();
			int [] mono = new int [n];
			int [] poly = new int [m];
			for (int i=0; i<n; i++) {
				mono[i] = sc.nextInt();
			}
			for (int i=0; i<m; i++) {
				poly[i] = sc.nextInt();
			}
			List<Integer> result = findSeq(mono, poly, k);
			System.out.println();
			for (int number : result) {
				System.out.print(number + " ");
			}
			//System.out.println();
		}
	}
}
