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;

void solve()
{
	int n,k,m;
	cin>>k>>n>>m;
	int a1[n],a2[m];
	for(int i=0;i<n;i++) cin>>a1[i];
	for(int i=0;i<m;i++) cin>>a2[i];
	int curr = k;
	int s1 =0, s2=0;
	vector<int> ans;
	while(1)
	{
		if(s1==n && s2==m) break;
		if(a1[s1]<=curr && s1<n)
		{
			if(a1[s1]==0) curr++;
			ans.push_back(a1[s1]);
			s1++;
		}
		else if(a2[s2]<=curr && s2<m)
		{
			if(a2[s2]==0) curr++;
			ans.push_back(a2[s2]);
			s2++;
		}
		else
		{
			cout<<"-1\n";
			return;
		}
	}
	for(int x: ans) cout<<x<<" ";
	cout<<endl;
}

int main()
{
	int t;
	cin>>t;
	while(t--) solve();
}