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(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int k, n, m, i, c = 0;
    cin >> k >> n >> m;
    vector<long long int> a(n), b(m);
    multiset<long long int> s;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == 0) {
        c++;
      } else {
        s.insert(a[i]);
      }
    }
    for (i = 0; i < m; i++) {
      cin >> b[i];
      if (b[i] == 0) {
        c++;
      } else {
        s.insert(b[i]);
      }
    }
    auto it = s.rbegin();
    if (c + k < *it) {
      cout << -1 << endl;
    } else {
      while (c--) {
        cout << 0 << " ";
      }
      for (auto pp = s.begin(); pp != s.end(); pp++) cout << *pp << " ";
      cout << endl;
    }
  }
}
