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 unsigned long long M = 1000000007;
const long long mxN = 2e5;
const long long N = 100031;
bool bad = false;
long long dirs[5] = {-1, 0, 1, 0, -1};
bool dp[2][27];
bool dfs(string s, char lastv) {
  long long n = s.size();
  char first = s[0], last = s[n - 1];
  bool ans;
  if (s.size() == 1 && s[0] == 'a') return true;
  if (s.size() == 1) return false;
  char temp = lastv - 1;
  if (s[n - 1] == lastv) {
    ans = dfs(s.substr(0, n - 1), temp);
  } else if (s[0] == lastv) {
    ans = dfs(s.substr(1), temp);
  } else {
    return false;
  }
  return ans;
}
void solve() {
  long long k, n, m;
  cin >> k >> n >> m;
  long long tot = k;
  long long ma = INT_MIN;
  vector<long long> a(n), b(m);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 0) k++;
    ma = max(ma, a[i]);
  }
  for (long long i = 0; i < m; i++) {
    cin >> b[i];
    if (b[i] == 0) k++;
    ma = max(ma, b[i]);
  }
  if (ma > k) {
    cout << -1 << '\n';
    return;
  }
  long long i = 0, j = 0;
  vector<long long> ans;
  for (long long l = 0; l < n + m; l++) {
    if (a[i] == 0) {
      tot++;
      i++;
      ans.push_back(0);
    } else if (b[j] == 0) {
      tot++;
      j++;
      ans.push_back(0);
    } else if (a[i] <= tot) {
      ans.push_back(a[i++]);
    } else if (b[j] <= tot) {
      ans.push_back(b[j++]);
    } else {
      cout << -1 << '\n';
      return;
    }
  }
  for (auto x : ans) {
    cout << x << " ";
  }
  cout << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
}
