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;
long long pow(long long a, long long b, long long m) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans;
}
long long SumOfDigits(long long x) {
  if (x < 0) return -1;
  long long s = 0;
  while (x) {
    s += x % 10;
    x /= 10;
  }
  return s;
}
inline void solve() {
  long long k, n, m;
  cin >> k >> n >> m;
  long long a[n], b[m];
  long long cnt1 = 0, cnt2 = 0;
  vector<long long> x, y;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < m; i++) {
    cin >> b[i];
  }
  vector<long long> ans;
  long long i = 0, j = 0;
  long long total = k;
  while (1) {
    if (ans.size() == n + m) break;
    if (a[i] == 0 && i < n) {
      ans.push_back(0);
      total++;
      i++;
    } else if (b[j] == 0 && j < m) {
      ans.push_back(0);
      total++;
      j++;
    }
    if ((a[i] < b[j] && (i < n && j < m)) || i < n && j >= m) {
      if (total >= a[i]) {
        ans.push_back(a[i]);
        i++;
      } else {
        cout << -1 << '\n';
        return;
      }
    } else if ((a[i] >= b[j] && (j < m && i < n)) || j < m && i >= n) {
      if (total >= b[j]) {
        ans.push_back(b[j]);
        j++;
      } else {
        cout << -1 << '\n';
        return;
      }
    }
  }
  if (ans.size() == n + m) {
    for (auto x : ans) cout << x << ' ';
    cout << '\n';
  } else
    cout << -1 << '\n';
  return;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  cin >> t;
  for (long long tt = 1; tt <= t; tt++) {
    solve();
  }
  return 0;
}
