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>
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC target("avx2")
using namespace std;
template <typename T>
void maxtt(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
const long long MOD2 = (long long)1000000007 * (long long)1000000007;
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 1000000007) {
  x += y;
  if (x >= mod) x -= mod;
  if (x < 0) x += mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
double gcd(double a, double b) {
  if (a < b) return gcd(b, a);
  if (fabs(b) < 0.001)
    return a;
  else
    return (gcd(b, a - floor(a / b) * b));
}
void fmain(int tid) {
  long long n, k, m;
  long long a = 0, b = 0, c = 0, f = 0, j = 0, l = 0, i = 0, aa = 0, bb = 0, cc,
            dd = 0, p = 0, r = 0, d;
  string s;
  cin >> n >> a >> b;
  vector<long long> v;
  vector<long long> va(a);
  vector<long long> vb(b);
  l = n;
  for (i = 0; i < a; i++) {
    cin >> va[i];
    aa = max(aa, va[i]);
  }
  for (i = 0; i < b; i++) {
    cin >> vb[i];
    aa = max(aa, vb[i]);
  }
  j = min(a, b);
  for (i = 0; i < j; i++) {
    if (va[i] > vb[i]) {
      v.push_back(vb[i]);
      v.push_back(va[i]);
    } else {
      v.push_back(va[i]);
      v.push_back(vb[i]);
    }
  }
  r = 1;
  i = 0;
  j = 0;
  while (r) {
    while (va[i] < vb[j] && r) {
      v.push_back(va[i]);
      i++;
      if (i == a) {
        for (k = j; k < b; k++) {
          v.push_back(vb[k]);
        }
        r = 0;
        break;
      }
    }
    while (va[i] > vb[j] && r) {
      v.push_back(vb[j]);
      j++;
      if (j == b) {
        for (k = i; k < a; k++) {
          v.push_back(va[k]);
        }
        r = 0;
        break;
      }
    }
  }
  for (i = 0; i < (a + b); i++) {
    if (v[i] == 0) {
      l++;
    } else if (v[i] > l) {
      cout << "-1" << endl;
      return;
    }
  }
  for (i = 0; i < (a + b); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
int main() {
  int t = 1;
  long long a, b, n, bb = 0;
  scanf("%d", &t);
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
