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;
const long double PI = 3.14159265358979323846;
const long double EPS = 0.0000000000001;
const long long MD_7 = 1000000007;
const long long MD_9 = 1000000009;
const long long MD = 228228227;
const long long INF = INT64_MAX;
void solve() {
  long long k, n, m;
  cin >> k >> n >> m;
  vector<long long> a(n), b(m), rs;
  for (long long i = 0; i < n; ++i) cin >> a[i];
  for (long long i = 0; i < m; ++i) cin >> b[i];
  long long fit = 0, sit = 0;
  while (fit < n || sit < m) {
    if (fit < n && a[fit] == 0) {
      k++;
      rs.push_back(0);
      ++fit;
    } else if (sit < m && b[sit] == 0) {
      k++;
      rs.push_back(0);
      ++sit;
    } else if (fit == n && b[sit] > k || sit == m && a[fit] > k) {
      cout << -1 << '\n';
      return;
    } else if (fit == n || a[fit] > b[sit]) {
      if (b[sit] <= k)
        rs.push_back(b[sit++]);
      else {
        cout << -1 << '\n';
        return;
      }
    } else if (a[fit] <= k)
      rs.push_back(a[fit++]);
    else {
      cout << -1 << '\n';
      return;
    }
  }
  for (auto el : rs) cout << el << ' ';
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
