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 <iostream>
#include<vector>
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--){
		int k,n,m;
		cin>>k>>n>>m;
		int a[n],b[m];
		for(int i = 0;i < n;i++)
		cin>>a[i];
		for(int i = 0;i < m;i++)
		cin>>b[i];
		
		vector<int> res;
		int i=0,j=0;
		bool flag=true;
		while(i!=n || j!=m){
			if( i!=n && a[i] == 0 ){
				res.push_back(0);
				i++;
				k++;
			}else if(j != m && b[j] == 0){
				res.push_back(0);
				j++;
				k++;
			}
			else if( i!=n && a[i] <= k){
				res.push_back(a[i++]);
			}
			else if( j!= m && b[j] <= k){
				res.push_back(b[j++]);
			}
			else{
				flag=false;
				cout<<-1;
				break;
			}
		}
		if(flag){
			for(auto it: res)
			cout<<it<<" ";
		}
		cout<<endl;
	}
	return 0;
}