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 vi vector<int>
#define pb push_back
#define sv(v) sort(v.begin(), v.end())
#define rsv(v) sort(v.rbegin(), v.rend())
#define pv(v)        \
    for (auto x : v) \
    cout << x << ' '
#define tv(v)         \
    for (auto &x : v) \
    cin >> x
typedef long long int ll;

void solve()
{
    int k, n, m;
    cin >> k >> n >> m;
    vi a(n), b(m), ans;
    tv(a);
    tv(b);
    int i = 0, j = 0;
    while (i < n && j < m)
    {
        if (a[i] == 0)
        {
            ans.pb(a[i]);
            i++;
            k++;
            continue;
        }
        if (b[j] == 0)
        {
            ans.pb(b[j]);
            j++;
            k++;
            continue;
        }
        if (a[i] <= k)
        {
            ans.pb(a[i]);
            i++;
            continue;
        }
        if (b[j] <= k)
        {
            ans.pb(b[j]);
            j++;
            continue;
        }
        cout << -1 << endl;
        return;
    }
    while (i < n)
    {
        if (a[i] == 0)
        {
            ans.pb(a[i]);
            i++;
            k++;
            continue;
        }
        if (a[i] <= k)
        {
            ans.pb(a[i]);
            i++;
            continue;
        }
        cout << -1 << endl;
        return;
    }
    while (j < m)
    {

        if (b[j] == 0)
        {
            ans.pb(b[j]);
            j++;
            k++;
            continue;
        }
        if (b[j] <= k)
        {
            ans.pb(b[j]);
            j++;
            continue;
        }
        cout << -1 << endl;
        return;
    }
    pv(ans);
    cout << endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int testCase;
    cin >> testCase;
    while (testCase--)
    {
        solve();
    }
    return 0;
}