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;
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) {
  return os << "(" << p.first << " " << p.second << ")";
};
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "VECTOR: ";
  for (auto ele : vec) os << ele << " ";
  return os;
};
const int MAXN = 1005;
const int mod = 1e9 + 7;
void solution() {
  int k, n, m;
  cin >> k >> n >> m;
  vector<int> mono(n), poly(m);
  for (auto &x : mono) cin >> x;
  for (auto &x : poly) cin >> x;
  vector<int> ans;
  bool isDone = true;
  int pos1 = 0, pos2 = 0;
  while (pos1 < n && pos2 < m) {
    int val1 = mono[pos1];
    int val2 = poly[pos2];
    if (val1 == 0) {
      ans.push_back(val1);
      k++;
      pos1++;
      continue;
    }
    if (val2 == 0) {
      ans.push_back(val2);
      k++;
      pos2++;
      continue;
    }
    int MIN = min(val1, val2);
    if (MIN > k) {
      isDone = false;
      break;
    }
    ans.push_back(MIN);
    if (val1 == MIN) {
      pos1++;
      k++;
      continue;
    }
    if (val2 == MIN) {
      pos2++;
      k++;
      continue;
    }
  }
  if (pos1 != n) {
    for (int i = pos1; i < n; i++) {
      if (mono[i] == 0) k++;
      if (mono[i] > k) {
        isDone = false;
        break;
      }
      ans.push_back(mono[i]);
    }
  } else if (pos2 != m) {
    for (int i = pos2; i < m; i++) {
      if (poly[i] == 0) k++;
      if (poly[i] > k) {
        isDone = false;
        break;
      }
      ans.push_back(poly[i]);
    }
  }
  if (!isDone)
    cout << -1 << '\n';
  else {
    for (auto x : ans) cout << x << " ";
    cout << '\n';
  }
}
int32_t main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  ;
  int test = 1;
  cin >> test;
  cin.ignore();
  while (test--) solution();
  return 0;
}
