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;
long long llmax = numeric_limits<long long>::max();
long long llmin = numeric_limits<long long>::min();
int arr[110], grr[110];
int mat[1030][11];
char grid[60][60];
char gl[60][60];
char gn[60][60];
vector<int> v;
vector<string> srr;
vector<int> vy;
vector<vector<int> > g;
vector<pair<int, pair<int, int> > > pv;
map<long long, int> mp;
priority_queue<pair<int, int>, vector<pair<int, int> >,
               greater<pair<int, int> > >
    pqr;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    cout << endl;
    int k, n, m;
    cin >> k >> n >> m;
    v.clear();
    for (int i = 0; i < n; i++) cin >> arr[i];
    for (int i = 0; i < m; i++) cin >> grr[i];
    int as = 0, gs = 0;
    int tt = n + m;
    while (tt--) {
      if (arr[as] == 0 && as < n) {
        k++;
        v.push_back(arr[as]);
        as++;
      } else if (arr[as] <= k && as < n) {
        v.push_back(arr[as]);
        as++;
      }
      if (grr[gs] == 0 && gs < m) {
        k++;
        v.push_back(grr[gs]);
        gs++;
      } else if (arr[gs] <= k && gs < m) {
        v.push_back(grr[gs]);
        gs++;
      }
    }
    if (v.size() == n + m) {
      int sz = v.size();
      for (int i = 0; i < sz; i++) cout << v[i] << " ";
      cout << endl;
    } else {
      cout << "-1" << endl;
    }
  }
}
