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 pow(long long a, long long b, long long m) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans;
}
long long SumOfDigits(long long x) {
  if (x < 0) return -1;
  long long s = 0;
  while (x) {
    s += x % 10;
    x /= 10;
  }
  return s;
}
inline void solve() {
  long long k, n, m;
  cin >> k >> n >> m;
  long long a[n], b[m];
  long long mx = INT_MIN, mn = INT_MAX;
  long long cnt1 = 0, cnt2 = 0;
  vector<long long> x;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) {
      mx = max(a[i], mx);
      mn = min(a[i], mn);
      x.push_back(a[i]);
    } else
      cnt1++;
  }
  for (long long i = 0; i < m; i++) {
    cin >> b[i];
    if (b[i] != 0) {
      mx = max(b[i], mx);
      mn = min(b[i], mn);
      x.push_back(b[i]);
    } else
      cnt2++;
  }
  sort(x.begin(), x.end());
  ;
  if (k + cnt1 + cnt2 < mn || k + cnt1 + cnt2 < mx) {
    cout << -1 << '\n';
    return;
  }
  vector<long long> ans;
  long long cnt = cnt1 + cnt2;
  long long i = 0, j = 0;
  long long total = k;
  while (i < x.size()) {
    if (total >= x[i]) {
      ans.push_back(x[i]);
      i++;
    } else {
      if (cnt > 0) {
        ans.push_back(0);
        total++;
        cnt--;
      } else {
        cout << -1 << '\n';
      }
    }
  }
  if (ans.size() == n + m) {
    for (auto x : ans) cout << x << ' ';
    cout << '\n';
  } else
    cout << -1 << '\n';
  return;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  cin >> t;
  for (long long tt = 1; tt <= t; tt++) {
    solve();
  }
  return 0;
}
