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++;
      }
    }
    int a = *max_element(mono.begin(), mono.end());
    int b = *max_element(poly.begin(), poly.end());
    if (zeroes + k >= max(a, b)) {
      if (a > b) {
        int i = 0;
        while (zeroes > 0 && i < poly.size()) {
          cout << 0 << " " << poly[i] << " ";
          i++;
          zeroes--;
        }
        while (zeroes > 0) {
          cout << 0 << " ";
          zeroes--;
        }
        while (i < poly.size()) {
          cout << poly[i] << " ";
          i++;
        }
        int j = 0;
        while (zeroes > 0 && j < mono.size()) {
          cout << 0 << " " << mono[j] << " ";
          j++;
          zeroes--;
        }
        while (zeroes > 0) {
          cout << 0 << " ";
          zeroes--;
        }
        while (j < mono.size()) {
          cout << mono[j] << " ";
          j++;
        }
        cout << endl;
      } else {
        int j = 0;
        while (zeroes > 0 && j < mono.size()) {
          cout << 0 << " " << mono[j] << " ";
          j++;
          zeroes--;
        }
        while (zeroes > 0) {
          cout << 0 << " ";
          zeroes--;
        }
        while (j < mono.size()) {
          cout << mono[j] << " ";
          j++;
        }
        int i = 0;
        while (zeroes > 0 && i < poly.size()) {
          cout << 0 << " " << poly[i] << " ";
          i++;
          zeroes--;
        }
        while (zeroes > 0) {
          cout << 0 << " ";
          zeroes--;
        }
        while (i < poly.size()) {
          cout << poly[i] << " ";
          i++;
        }
        cout << endl;
      }
    } else {
      cout << -1 << endl;
    }
    t--;
  }
}
