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;
int mod = 1e9 + 7;
int modd = 998244353;
const int MAX = 2e5 + 5;
const int inf = 1e9;
long long bipow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * 1LL * a) % mod;
    a = (a * 1LL * a) % mod;
    b >>= 1;
  }
  return ans;
}
bool isPrime(int x) {
  if (x == 1)
    return 0;
  else if (x == 2 || x == 3)
    return 1;
  if (x % 2 == 0 || x % 3 == 0) return 0;
  for (int i = 5; i * i <= x; i += 6) {
    if (x % i == 0 || x % (i + 2) == 0) return 0;
  }
  return 1;
}
inline long long add(long long x, long long y) {
  return (x % mod + y % mod) % mod;
}
inline long long sub(long long x, long long y) {
  if (x < 0) x += mod;
  if (y < 0) y += mod;
  return (x % mod - y % mod + mod) % mod;
}
inline long long mul(long long x, long long y) {
  return ((x % mod) * (y % mod)) % mod;
}
inline long long dvd(long long x, long long y) {
  return mul(x, bipow(y, mod - 2));
}
void solve() {
  int k, n, m;
  cin >> k >> n >> m;
  int a[n], b[m];
  for (int &x : a) cin >> x;
  for (int &x : b) cin >> x;
  int i = 0, j = 0;
  int cur = k;
  vector<int> ans;
  while (i < n && j < m) {
    if (a[i] == 0) {
      ans.push_back(0);
      cur++;
      i++;
    } else if (b[j] == 0) {
      ans.push_back(0);
      cur++;
      j++;
    } else if (a[i] <= cur) {
      ans.push_back(a[i]);
      i++;
    } else if (b[i] <= cur) {
      ans.push_back(b[j]);
      j++;
    } else {
      cout << -1 << endl;
      return;
    }
  }
  while (i < n) {
    if (a[i] == 0)
      cur++, ans.push_back(0);
    else if (a[i] <= cur)
      ans.push_back(a[i]);
    else {
      cout << -1 << endl;
      return;
    }
    i++;
  }
  while (j < m) {
    if (b[j] == 0)
      cur++, ans.push_back(0);
    else if (b[j] <= cur)
      ans.push_back(b[j]);
    else {
      cout << -1 << endl;
      return;
    }
    j++;
  }
  for (int &x : ans) cout << x << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tc = 1;
  cin >> tc;
  while (tc--) {
    solve();
  }
  return 0;
}
