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;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, k, tt, n, m, x, y;
  cin >> tt;
  while (tt--) {
    int k, n, m;
    cin >> k >> n >> m;
    vector<int> v(n);
    vector<int> a(m);
    int c = 0;
    for (i = 0; i < n; i++) cin >> v[i];
    for (i = 0; i < m; i++) cin >> a[i];
    vector<int> b;
    for (i = 0; i < n; i++) {
      if (v[i] == 0)
        c++;
      else
        b.push_back(v[i]);
    }
    for (i = 0; i < m; i++) {
      if (a[i] == 0)
        c++;
      else
        b.push_back(a[i]);
    }
    sort(b.begin(), b.end());
    if (b.size() != 0 && k + c < b[b.size() - 1]) {
      cout << -1 << endl;
      continue;
    }
    for (i = 0; i < c; i++) cout << 0 << " ";
    for (i = 0; i < b.size(); i++) {
      cout << b[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
