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

#include<bits/stdc++.h>
using namespace std;
int T,n,m,flag,k,a[110],b[110],ans[300];
int main()
{
	scanf("%d",&T);
	while (T--) {
		scanf("%d%d%d",&k,&n,&m);
		for (int i=1;i<=n;i++) scanf("%d",&a[i]);
		for (int i=1;i<=m;i++) scanf("%d",&b[i]);
		flag=1;
		for (int i=1,j=1;i<=n||j<=m;) {
			if ((a[i]>k||i>n)&&(b[j]>k||j>m)) {
				flag=0;
				break;
			}
			while (a[i]<=k&&i<=n) {
				ans[i+j-1]=a[i];
				if (a[i]==0) k++;
				i++;
			}
			while (b[j]<=k&&j<=m) {
				ans[i+j-1]=b[j];
				if (b[j]==0) k++;
				j++;
			}
		}
		if (flag) {
			for (int i=1;i<=n+m;i++) printf("%d ",ans[i]);
			printf("\n");
		} else {
			printf("-1\n");
		}
	}
	return 0;
}

