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;
#define ll long long
want()
{
 ll n,m,k,i,j,t=1;
 vector<ll> v;
 cin>>k>>n>>m;
 ll a[n];
 ll b[m];
 for(i=0;i<n;i++)
    cin>>a[i];
 for(i=0;i<m;i++)
   cin>>b[i];
 i=0,j=0;
 while(i<n||j<m)
 {
     if(a[i]==0&&i<n)
     {
         v.push_back(a[i]);
         i++;
         k++;
     }
     else if(b[i]==0&&j<m)
     {
         v.push_back(b[j]);
         j++;
         k++;
     }
      else if(a[i]<=k&&i<n)
     {
         v.push_back(a[i]);
         i++;
     }
     else if(b[j]<=k&&j<m)
     {
         v.push_back(b[j]);
         j++;
     }
     else
     {
         cout<<-1<<endl;
         return 0;
         t=0;
     }
 }
 if(t==1)
 {
     for(auto child:v)
        cout<<child<<' ';
     cout<<endl;
 }

}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t;
    cin>>t;
    while(t--)
    {
        want();
    }

}

