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 Pair{
	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();
			int [] a = new int[n];
			int [] b = new int[m];
			for(int i=0;i<n;i++)
				a[i]=sc.nextInt();
			for(int i=0;i<m;i++)
				b[i]=sc.nextInt();
			List<Integer> list = new ArrayList<Integer>();
			int i=0,j=0;
			while(i<n || j<m){
				boolean aBoo = false;
				boolean bBoo = false;
				if(i<n){
				if(a[i]>0){
					if(a[i]<=k){
						list.add(a[i]);
						i++;
						continue;
					}else{
						aBoo=true;
					}
				}else{
					list.add(a[i]);
					i++;
					k++;
					continue;
				}
				}
				if(j<m){
				if(b[j]>0){
					if(b[j]<=k){
						list.add(b[j]);
						j++;
						continue;
					}else {
						bBoo=true;
					}
				}else {
					list.add(b[j]);
					j++;
					k++;
					continue;
				}
				}
				if(aBoo||bBoo){
					list.clear();
					list.add(-1);
					break;
				}
				//System.out.println(i+" "+j);
			}
			for(Integer d: list)
				System.out.print(d+" ");
			System.out.println();
		}
	}
}