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;
const long long mod = 1e9 + 7;
const long long MAX = 100005;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    int k, n, m;
    cin >> k >> n >> m;
    vector<int> a(n);
    vector<int> b(m);
    for (long long i = 0; i < n; ++i) cin >> a[i];
    for (long long i = 0; i < m; ++i) cin >> b[i];
    int i = 0;
    int j = 0;
    bool f = true;
    vector<int> res;
    while (i < n or j < m) {
      if (a[i] == 0) {
        k++;
        res.push_back(a[i]);
        i++;
      } else if (b[j] == 0) {
        k++;
        res.push_back(b[j]);
        j++;
      } else if (a[i] <= k) {
        res.push_back(a[i]);
        i++;
      } else if (b[j] <= k) {
        res.push_back(b[j]);
        j++;
      } else {
        f = false;
        break;
      }
    }
    if (f) {
      for (long long l = 0; l < res.size(); ++l) {
        cout << res[l] << ' ';
      }
      cout << endl;
    } else {
      cout << -1 << endl;
    }
  }
  return 0;
}
