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() {
  int k, n, m;
  cin >> k >> n >> m;
  int a[n], b[m];
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 0) cnt++;
  }
  for (int j = 0; j < m; j++) {
    cin >> b[j];
    if (b[j] == 0) cnt++;
  }
  k += cnt;
  vector<int> v;
  for (int i = 0; i < k; i++) v.push_back(0);
  for (int i = 0; i < n; i++) {
    if (a[i] > k) {
      cout << "-1"
           << "\n";
      return;
    } else {
      v[a[i] - 1] = a[i];
    }
  }
  for (int j = 0; j < m; j++) {
    if (b[j] > k) {
      cout << "-1"
           << "\n";
      return;
    } else {
      v[b[j] - 1] = b[j];
    }
  }
  int p = n + m;
  vector<int> ans;
  for (int i = v.size() - 1; i >= 0; i--) {
    if (p == 0)
      break;
    else {
      ans.push_back(v[i]);
      p--;
    }
  }
  reverse(ans.begin(), ans.end());
  for (auto it : ans) {
    cout << it << " ";
  }
  cout << "\n";
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
