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;
  vector<int> a(n);
  int cnt = 0;
  for (auto &i : a) {
    cin >> i;
    if (i == 0) cnt++;
  }
  vector<int> b(m);
  for (auto &i : b) {
    cin >> i;
    if (i == 0) cnt++;
  }
  k += cnt;
  vector<int> res(n + m);
  for (int i = 0; i < cnt; ++i) res[i] = 0;
  int ind = cnt;
  for (int i = 0; i < n; ++i) {
    if (a[i] != 0) {
      if (a[i] > k) {
        cout << -1 << endl;
        return;
      }
      res[ind] = a[i];
      ind++;
    }
  }
  for (int i = 0; i < m; ++i) {
    if (b[i] != 0) {
      if (b[i] > k) {
        cout << -1 << endl;
        return;
      }
      res[ind] = b[i];
      ind++;
    }
  }
  for (auto x : res) cout << x << " ";
  cout << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
