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 tc() {
  int k, n, m;
  cin >> k >> n >> m;
  int a[n + 1], b[m + 1];
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) cin >> b[i];
  vector<int> v(k + 1);
  int l = 1, r = 1;
  while (l <= n && r <= m) {
    if (a[l] < b[r]) {
      v.push_back(a[l++]);
    } else {
      v.push_back(b[r++]);
    }
  }
  for (int i = l; i <= n; i++) v.push_back(a[l]);
  for (int i = r; i <= m; i++) v.push_back(b[r]);
  for (int i = 1; i < v.size(); i++)
    if (v[i] >= i) {
      cout << -1 << '\n';
      return;
    }
  for (int i = k + 1; i < v.size(); i++) cout << v[i] << ' ';
  cout << '\n';
}
signed main() {
  int t;
  cin >> t;
  while (t--) tc();
  return 0;
}
