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 test();
void preprocessing();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    test();
    cout << endl;
  }
  return 0;
}
void preprocessing() { return; }
void test() {
  int k, n, m;
  cin >> k >> n >> m;
  vector<int> a, b;
  int num;
  int zero = 0;
  for (int i = 0; i < n; i++) {
    cin >> num;
    if (num == 0)
      zero++;
    else
      a.push_back(num);
  }
  for (int j = 0; j < m; j++) {
    cin >> num;
    if (num == 0)
      zero++;
    else
      b.push_back(num);
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  vector<int> ans;
  for (int i = 0; i < zero; i++) ans.push_back(0);
  k = k + zero;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] > k) {
      cout << "-1";
      return;
    }
    ans.push_back(a[i]);
  }
  for (int i = 0; i < b.size(); i++) {
    if (b[i] > k) {
      cout << "-1";
      return;
    }
    ans.push_back(b[i]);
  }
  for (int x : ans) {
    cout << x << " ";
  }
  return;
}
