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

public class C {
	public static void main(String[] args) {
		FastReader in = new FastReader();
		
		int T = in.nextInt();
		while(T-- > 0) {
			int k = in.nextInt();
			int n = in.nextInt();
			int m = in.nextInt();
			int[] a = in.readInt(n);
			int[] b = in.readInt(m);
			boolean p = true;

			StringBuilder ans = new StringBuilder();
			
			for(int i = 0; i < Math.min(n, m); i++) {
				if(a[i]==0 && b[i]==0) {
					ans.append(a[i] + " ");
					ans.append(b[i] + " ");
					k+=2;
				}
				else if((a[i]!=0 && b[i]!=0)) {
					if(a[i]>k || b[i]>k) {
						p = false;
						break;
					}
					else {
						ans.append(a[i] + " ");
						ans.append(b[i] + " ");
					}
				}
				else if(a[i]==0 || b[i]==0) {
					if(a[i]==0) {
						if(b[i]>k+1) {
							p = false;
							break;
						}
						else {
							ans.append(a[i] + " ");
							ans.append(b[i] + " ");
						}
					}
					else {
						if(a[i]>k+1) {
							p = false;
							break;
						}
						else {
							ans.append(b[i] + " ");
							ans.append(a[i] + " ");
						}
					}
					k++;
				}
			}
			if(!p) {
				System.out.println(-1);
				continue;
			}

			if(n > m) { // a longer
				for(int i = m; i < n; i++) {
					if(a[i]>k) {
						p = false;
						break;
					}
					if(a[i]==0) {
						ans.append("0 ");
						k++;
					}
					else {
						ans.append(a[i] + " ");
					}
				}
			}
			else if(m > n) {
				for(int i = n; i < m; i++) {
					if(b[i]>k) {
						p = false;
						break;
					}
					if(b[i]==0) {
						ans.append("0 ");
						k++;
					}
					else {
						ans.append(b[i] + " ");
					}
				}
			}
			if(!p) {
				System.out.println(-1);
				continue;
			}
			System.out.println(ans);
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;
		public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); }
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch(IOException e) { e.printStackTrace(); }
			}
			return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
		double nextDouble() { return Double.parseDouble(next()); }
		String nextLine() {
			String str = "";
			try { str = br.readLine(); }
			catch(IOException e) { e.printStackTrace(); }
			return str;
		}
		int[] readInt(int size) {
			int[] arr = new int[size];
			for(int i = 0; i < size; i++)
				arr[i] = Integer.parseInt(next());
			return arr;
		}
		long[] readLong(int size) {
			long[] arr = new long[size];
			for(int i = 0; i < size; i++)
				arr[i] = Long.parseLong(next());
			return arr;
		}
		int[][] read2dArray(int rows, int cols) {
			int[][] arr = new int[rows][cols];
			for(int i = 0; i < rows; i++) {
				for(int j = 0; j < cols; j++)
					arr[i][j] = Integer.parseInt(next());
			}
			return arr;
		}
	}
}