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;
long long int n, m, k, x, y, a, b, c;
void solve() {
  cin >> k >> n >> m;
  vector<int> a(n);
  for (auto& x : a) cin >> x;
  vector<int> b(m);
  for (auto& x : b) cin >> x;
  vector<int> ans;
  for (int i = 0; i < max(n, m); ++i) {
    if (i > n - 1) {
      if (b[i] > k) {
        cout << -1 << endl;
        return;
      }
      ans.push_back(b[i]);
      continue;
    } else if (i > m - 1) {
      if (a[i] > k) {
        cout << -1 << endl;
        return;
      }
      ans.push_back(a[i]);
      continue;
    }
    if (a[i] > 0) {
      if (a[i] <= k) {
        if (b[i] == 0) {
          ++k;
          ans.push_back(b[i]);
          ans.push_back(a[i]);
        }
      } else if (a[i] <= (k + 1)) {
        if (b[i] == 0) {
          ++k;
          ans.push_back(b[i]);
          ans.push_back(a[i]);
        } else {
          cout << -1 << endl;
          return;
        }
      }
    } else if (a[i] == 0) {
      if (b[i] <= (k + 1)) {
        ++k;
        ans.push_back(a[i]);
        ans.push_back(b[i]);
      } else {
        cout << -1 << endl;
        return;
      }
    }
  }
  for (auto i : ans) cout << i << " ";
  cout << endl;
}
int main() {
  auto start = chrono::high_resolution_clock::now();
  int t = 1;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    solve();
  }
  return 0;
}
