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;
using ll = long long;
const ll MAX = 1e18 + 1;
const int NN = 1e5 + 5;
const int mod = 1e9 + 7;
void solve() {
  int k, n, m;
  cin >> k >> n >> m;
  int a[n], b[m];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  vector<int> v;
  int ai = 0, bi = 0, turn = 1;
  while (v.size() != n + m) {
    if (turn) {
      if (ai < n && a[ai] == 0) {
        v.push_back(0);
        k++, ai++;
      } else if (ai < n && a[ai] <= k) {
        v.push_back(a[ai]);
        ai++;
      } else if (bi >= m || b[bi] != 0) {
        cout << -1 << endl;
        return;
      }
    } else {
      if (bi < m && b[bi] == 0) {
        v.push_back(0);
        k++, bi++;
      } else if (bi < m && b[bi] <= k) {
        v.push_back(b[bi]);
        bi++;
      } else if (ai >= n || a[ai] != 0) {
        cout << -1 << endl;
        return;
      }
    }
    turn ^= 1;
  }
  for (auto it : v) cout << it << " ";
  cout << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
