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, a, b;
  cin >> k >> a >> b;
  vector<int> a1(a), a2(b);
  for (int i = 0; i < a; i++) cin >> a1[i];
  for (int i = 0; i < b; i++) cin >> a2[i];
  vector<int> temp;
  if (a < b) {
    for (int i = a; i < b; i++) temp.push_back(a2[i]);
  } else {
    for (int i = b; i < a; i++) temp.push_back(a1[i]);
  }
  vector<int> res;
  int l = min(a, b);
  for (int i = 0; i < l; i++) {
    if (a1[i] == 0) {
      k++;
      res.push_back(0);
      if (a2[i] <= k)
        res.push_back(a2[i]);
      else {
        cout << -1 << "\n";
        return;
      }
    } else if (a2[i] == 0) {
      k++;
      res.push_back(0);
      if (a1[i] <= k)
        res.push_back(a1[i]);
      else {
        cout << -1 << "\n";
        return;
      }
    } else {
      if (max(a1[i], a2[i]) <= k) {
        res.push_back(a2[i]);
        res.push_back(a1[i]);
      } else {
        cout << -1 << "\n";
        return;
      }
    }
  }
  for (auto j : temp) {
    if (j == 0) {
      k++;
      res.push_back(0);
    } else if (j <= k and j != 0) {
      res.push_back(j);
    } else {
      cout << -1 << "\n";
      return;
    }
  }
  for (auto i : res) {
    cout << i << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
