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;
template <typename T>
int binary_search(vector<T> &vec, T n) {
  int l = vec.size();
  int left = 0;
  int right = l - 1;
  while (left != right) {
    int mid = (left + right + 1) / 2;
    if (vec[mid] > n)
      right = mid - 1;
    else
      left = mid;
  }
  return vec[left] == n ? left : -1;
}
long long bs_lowest(const function<bool(long long)> &f, long long lo,
                    long long hi) {
  while (lo < hi) {
    long long m = (lo + hi) / 2;
    f(m) ? hi = m : lo = m + 1;
  }
  return lo;
}
long long bs_highest(const function<bool(long long)> &f, long long lo,
                     long long hi) {
  while (lo < hi) {
    long long m = (lo + hi + 1) / 2;
    f(m) ? lo = m : hi = m - 1;
  }
  return lo;
}
vector<string> split(const string &str, const string &delim) {
  vector<string> tokens;
  size_t prev = 0, pos = 0;
  do {
    pos = str.find(delim, prev);
    if (pos == string::npos) pos = str.length();
    string token = str.substr(prev, pos - prev);
    if (!token.empty()) tokens.push_back(token);
    prev = pos + delim.length();
  } while (pos < str.length() && prev < str.length());
  return tokens;
}
struct cow {
  int l, r;
};
bool cmp(const cow &x, const cow &y) {
  if (x.r != y.r) {
    return x.r < y.r;
  }
  return x.l < y.l;
}
void solve() {
  int b, c, d;
  cin >> b >> c >> d;
  vector<int> vec(c);
  vector<int> vect(d);
  for (int i = 0; i < c; i++) {
    cin >> vec[i];
  }
  for (int i = 0; i < d; i++) {
    cin >> vect[i];
  }
  int first = 0;
  int second = 0;
  vector<int> ans;
  while (first < c && second < d) {
    if (vec[first] == 0) {
      b++;
      ans.push_back(vec[first]);
      first++;
    } else if (vect[second] == 0) {
      b++;
      ans.push_back(vect[second]);
      second++;
    } else if (vec[first] <= b) {
      ans.push_back(vec[first]);
      first++;
    } else if (vect[second] <= b) {
      ans.push_back(vect[second]);
      second++;
    } else {
      cout << -1;
      return;
    }
  }
  if (first < c) {
    for (int i = first; i < c; i++) {
      if (vec[first] == 0) {
        b++;
        ans.push_back(vec[first]);
      } else if (vec[first] <= b) {
        ans.push_back(vec[first]);
      } else {
        cout << -1;
        return;
      }
    }
  }
  if (second < d) {
    for (int i = second; i < d; i++) {
      if (vect[second] == 0) {
        b++;
        ans.push_back(vect[second]);
      } else if (vect[second] <= b) {
        ans.push_back(vect[second]);
      } else {
        cout << -1;
        return;
      }
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cerr.tie(0);
  int a;
  cin >> a;
  for (int i = 0; i < a; i++) {
    solve();
    cout << endl;
  };
}
