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

/* -----------------RISHABH VERMA------------*/
// swayam swayam 
// oct end tak specialist banna
// --> bhulna nahi !!

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
// header File

using namespace std;
using namespace __gnu_pbds;

#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define ll long long
#define pinf INT_MAX
#define minf INT_MIN
// Data Types 

#define for_i(i,v,n) for(ll i=v;i<(ll)n;++i)
#define for_j(j,i,n) for(ll j=i;j<(ll)n;++j)
#define for_r(i,n) for(ll i=(ll)n-1;i>0;--i)
#define for_s(i,vec) for(auto &i:vec)
// For Loops 

#define all_v(v) v.begin(),v.end()
#define all_a(v,n) v,v+n
// sort,reverse and other Functions

#define ve vector
#define se set
#define unmap unordered_map
#define unset unordered_set
#define pii pair<int,int>
#define vi vector<int>
#define mii map<int,int>
#define pqb priority_queue<int>
#define ar array
#define pqs priority_queue<int,vi,greater<int> >
#define setbits(x) __builtin_popcountll(x)
// Container

#define pp pop_back
#define pb push_back
// Vectors Methods

#define dis(k) cout << k << endl
#define endl "\n"
// Extra Things

ll mins(ll a,ll b){
  if(a>b) return b;
  return a;
}

ll maxs(ll a,ll b){
  if(a>b) return a;
  return b;
}
// Min Max

template<class T> using oset =tree<T, null_type,
less<T>, rb_tree_tag,tree_order_statistics_node_update> ;
// Template Classes

void solve(){
 
 ll k,n,m;
 cin>>k>>n>>m;
 ll a[n],b[m];
 ve<ll> ans;
 for_i(i,0,n)cin>>a[i];
 for_i(i,0,m)cin>>b[i];
 ll i=0;
 ll j=0;
 while(i<n and j<m){
  if(a[i]<b[j]) ans.pb(a[i++]);
  else ans.pb(b[j++]);
 }
 while(i<n) ans.pb(a[i++]);
 while(j<m) ans.pb(b[j++]);

 bool f=0;
 for_s(i,ans){
  if(!i) {
    if(i>k){
      f=1;
      break;
    }
    else{
      k++;
    }
  }
 }
 if(f==1) dis(-1);
 else {
  for_s(i,ans) cout<<i<<" ";
  cout<<endl;
 }
}
int main(){
  FIO;
  int t;
  cin>>t;
  while(t--){ 
      solve();
  }   
  return 0;
}