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;
bool is_prime(long long n) {
  if (n == 1) {
    return false;
  }
  long long i = 2;
  while (i * i <= n) {
    if (n % i == 0) {
      return false;
    }
    i += 1;
  }
  return true;
}
vector<long long> primeFactors(long long n) {
  vector<long long> v;
  while (n % 2 == 0) {
    v.push_back(2);
    n = n / 2;
  }
  for (long long i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      v.push_back(i);
      n = n / i;
    }
  }
  if (n > 2) v.push_back(n);
  return v;
}
long long gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(int a, int b) { return (a / gcd(a, b)) * b; }
bool isPower(long long x, long long y) {
  long long res1 = log(y) / log(x);
  double res2 = log(y) / log(x);
  return (res1 == res2);
}
string longDivision(string number, int divisor) {
  string ans;
  int idx = 0;
  int temp = number[idx] - '0';
  while (temp < divisor) temp = temp * 10 + (number[++idx] - '0');
  while (number.size() > idx) {
    ans += (temp / divisor) + '0';
    temp = (temp % divisor) * 10 + number[++idx] - '0';
  }
  if (ans.length() == 0) return "0";
  return ans;
}
int main() {
  int t;
  cin >> t;
  while (t > 0) {
    cin.ignore();
    int k, n, m;
    cin >> k >> n >> m;
    vector<int> mono(n);
    vector<int> poly(m);
    int zeroes = 0;
    for (int i = 0; i < n; i++) {
      cin >> mono[i];
      if (mono[i] == 0) {
        zeroes++;
      }
    }
    for (int i = 0; i < m; i++) {
      cin >> poly[i];
      if (poly[i] == 0) {
        zeroes++;
      }
    }
    vector<int> ans;
    bool flag = true;
    int i = 0;
    int j = 0;
    int count = 0;
    while (i < n && j < m) {
      if (mono[i] == 0) {
        ans.push_back(0);
        i++;
        count++;
      }
      if (poly[j] == 0) {
        ans.push_back(0);
        j++;
        count++;
      }
      if (mono[i] != 0 && poly[j] != 0) {
        if (min(mono[i], poly[j]) > (count + k)) {
          flag = false;
          break;
        } else {
          ans.push_back(min(mono[i], poly[j]));
          if (poly[j] > mono[i]) {
            i++;
          } else {
            j++;
          }
        }
      }
    }
    while (i < n) {
      if (mono[i] == 0) {
        ans.push_back(0);
        i++;
        count++;
      } else {
        if (count + k < mono[i]) {
          flag = false;
          break;
        } else {
          ans.push_back(mono[i]);
          i++;
        }
      }
    }
    while (j < m) {
      if (poly[j] == 0) {
        ans.push_back(0);
        j++;
        count++;
      } else {
        if (count + k < poly[j]) {
          flag = false;
          break;
        } else {
          ans.push_back(poly[j]);
          j++;
        }
      }
    }
    if (flag == false) {
      cout << -1 << endl;
    } else {
      for (int i = 0; i < ans.size(); ++i) {
        cout << ans[i] << " ";
      }
      cout << endl;
    }
    t--;
  }
}
