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;
long long int nad() {
  long long int n, m, k;
  cin >> k >> n >> m;
  long long int a[n], b[m];
  vector<long long int> ans;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long int i = 0; i < m; i++) {
    cin >> b[i];
  }
  long long int cur1 = 0, cur2 = 0, cnt = k;
  for (int i = 0; i < n + m + 5; i++) {
    if (cur1 < n && a[cur1] == 0) {
      ans.push_back(a[cur1]);
      cnt++;
      cur1++;
    } else if (cur2 < m && b[cur2] == 0) {
      ans.push_back(b[cur2]);
      cnt++;
      cur2++;
    } else if (cur1 < n && cur2 < m && a[cur1] != 0 && b[cur2] != 0) {
      if (a[cur1] < b[cur2]) {
        if (a[cur1] <= cnt) {
          ans.push_back(a[cur1]);
          cur1++;
        } else {
          cout << "-1" << endl;
          return 0;
        }
      } else {
        if (b[cur2] <= cnt) {
          ans.push_back(b[cur2]);
          cur2++;
        } else {
          cout << "-1" << endl;
          return 0;
        }
      }
    } else if (cur2 >= m && cur1 < n) {
      if (a[cur1] <= cnt) {
        ans.push_back(a[cur1]);
        cur1++;
      } else {
        cout << "-1" << endl;
        return 0;
      }
    } else if (cur2 < m && cur1 >= n) {
      if (b[cur2] <= cnt) {
        ans.push_back(b[cur2]);
        cur2++;
      } else {
        cout << "-1" << endl;
        return 0;
      }
    }
  }
  for (long long int i = 0; i < ans.size(); i++) {
    printf("%d ", ans[i]);
  }
  cout << endl;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    nad();
  }
  return 0;
}
