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 = 1000000007;
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void solve() {
  cin.ignore();
  int k, n, m;
  cin >> k >> n >> m;
  int a[n], b[m];
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  int p = 0, q = 0;
  for (int i = 0; i < n + m; i++) {
    if (p < n && a[p] == 0) {
      ans.push_back(0);
      p++;
      k++;
    } else if (q < m && b[q] == 0) {
      ans.push_back(0);
      q++;
      k++;
    } else {
      if (k < a[p] && k < b[q]) {
        cout << -1 << '\n';
        return;
      } else if (k >= b[q]) {
        ans.push_back(b[q]);
        q++;
      } else if (k >= a[p]) {
        ans.push_back(a[p]);
        p++;
      }
    }
  }
  for (int i = 0; i < n + m; i++) {
    cout << ans[i] << ' ';
  }
  cout << '\n';
}
int main() {
  fastio();
  int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
