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

//package Div_2B_Problems;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.ArrayList;
public class Codeforce713_C {
	public static void main(String args[]) {
		FastScanner fs=new FastScanner();
		int t=fs.nextInt();
		for(int t1=0;t1<t;t1++) {
			int k=fs.nextInt();
			int n=fs.nextInt();
			int m=fs.nextInt();
			int []arr1=new int[n];
			arr1=fs.readArray(n);
			int []arr2=new int[m];
			arr2=fs.readArray(m);
			int first=0;
			int second=0;
			int len=k;
			/*if(arr1[first]>len||arr2[second]>len)
			{
				System.out.println(-1);
				continue;
			}*/
			ArrayList<Integer> list=new ArrayList<>();
			boolean flag=false;
			while(first<n&&second<m) {
				int add=(arr1[first]==0?1:0)+(arr2[second]==0?1:0);
				len+=add;
				if(arr1[first]>len||arr2[second]>len) {
					flag=true;
					break;
				}
				if(arr1[first]<=arr2[second]) {
					list.add(arr1[first]);
					list.add(arr2[second]);
				}else {
					list.add(arr2[second]);
					list.add(arr1[first]);
				}
				first++;
				second++;
			}
			//System.out.println(flag);
			while(first<n) {
				int add=arr1[first]==0?1:0;
				len+=add;
				if(arr1[first]>len)
				{
					flag=true;
					break;
				}
				list.add(arr1[first]);
				first++;
			}
			//System.out.println(flag);
			while(second<m) {
				int add=arr2[second]==0?1:0;
				len+=add;
				if(arr2[second]>len) {
					flag=true;
					break;
				}
				list.add(arr2[second]);
				second++;
			}
			//System.out.println(flag);
			if(flag)
				System.out.println(-1);
			else {
				for(int val:list)
					System.out.print(val+" ");
				System.out.println();
			}
			
		}
	}
	static final Random random=new Random();	
	static void ruffleSort(int[] a) {
		int n=a.length;//shuffle, then sort 
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
	
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}
}
