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;
void solve() {
  long long k, n, m;
  cin >> k >> n >> m;
  long long a[n], b[m];
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < m; i++) cin >> b[i];
  bool f = true;
  long long i = 0, j = 0;
  vector<long long> v;
  while (i < n and j < m) {
    if (a[i] == 0) {
      v.push_back(a[i]);
      k++;
      i++;
    } else if (b[j] == 0) {
      v.push_back(b[j]);
      k++;
      j++;
    } else if (a[i] <= k) {
      v.push_back(a[i]);
      i++;
    } else if (b[j] <= k) {
      v.push_back(b[j]);
      j++;
    } else {
      f = false;
      break;
    }
  }
  while (i < n and f == true) {
    if (a[i] > k) {
      f = false;
      break;
    } else {
      v.push_back(a[i]);
      i++;
    }
  }
  while (j < m and f == true) {
    if (b[j] > k) {
      f = false;
      break;
    } else {
      v.push_back(b[j]);
      j++;
    }
  }
  if (f) {
    for (auto x : v) cout << x << " ";
  } else
    cout << -1;
  cout << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
