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>

#define MOD 1000000007
#define PI (2*acos(0.0))
#define eps 1e-9

#define ff first
#define ss second
#define pb push_back
#define endl '\n'
#define fu cout << "lol" << endl;
#define precision(n) cout << fixed << setprecision(n);
#define debug(x) cout << (#x) << " is " << (x) << endl;
#define printv(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi] << " "; cout << endl;
#define showpair(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi].first << " " << v[fi].second << endl;
#define all(a) a.begin(), a.end()
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define mem(a,val) memset(a,val,sizeof(a))

#define FORN(i, n) for(int i = ; i < n; i++)
#define REP(i, a, b) for(int i = a; i < b; i++)
#define SQ(a) (a)*(a)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef pair<int, int> pi;
typedef vector<pi> vpi;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vbb;


ull mod = 1e9 + 7;
// ull mod = 998244353;

ull fact(ull n){
    ull ans = 1;
    for (ull i = 2; i <= n; i++)
        ans = ((ans%MOD) * (i%MOD) )%MOD;
    return ans;
}
ll powMod(ll base, ll exp){
    ll ans = 1;
    for (int i = 0; i < exp; i++)
    {
        ans*= base;
        ans %= mod;
    }
    return ans;
}
ll powMod(ll base, ll exp, ll md){
    ll ans = 1;
    for (int i = 0; i < exp; i++)
    {
        ans*= base;
        ans %= md;
    }
    return ans;
}


// vi primes;

// void fillPrimes(){
//     for (int i = 2; i < 100000; i++)
//     {
//         bool ok = 1;
//         for(int k:primes){
//             if(i%k==0){
//                 ok = 0;
//                 break;
//             }
//         }
//         if(ok){
//             primes.pb(i);
//         }
//     }
// }

void answer(){
    int k, n, m; cin >> k >> n >> m;
    vi a(n), b(m);
    for(int &i:a) cin >>i;
    for(int &i:b) cin >>i;
    vi ans;

    int ca = 0, cb = 0;
    for (int i = 0; i < n+m; i++)
    {
        if(ca < n and a[ca] == 0){
            ca++;
            k++;
            ans.pb(0);
        }
        else if(cb < m and b[cb] == 0){
            cb++;
            k++;
            ans.pb(0);
        }
        else{
            if(ca < n and a[ca] <= k) {
                ans.pb(a[ca]);
                ca++;
            } else if(cb < m and b[cb] <= k){
                ans.pb(b[cb]);
                cb++;
            } else{
                cout << "-1\n";
                return;
            }
        }
    }
    for(int i:ans){
        cout << i << ' ';
    }
    cout << '\n';
}

 
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout << setprecision(6) << fixed;

    // fillPrimes();


    

#ifndef ONLINE_JUDGE
    freopen("in", "r", stdin);
    freopen("out", "w", stdout);
#endif

    int t = 1;
    cin >> t; cin.ignore();
    while (t--)
    {
        answer();
    }
    
    return 0;
}