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;
int main() {
  std::ios::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int k, n, m;
    cin >> k >> n >> m;
    vector<int> a, b;
    vector<int> ans;
    for (int i = 1; i <= n; i++) {
      int d;
      cin >> d;
      a.push_back(d);
    }
    for (int i = 1; i <= m; i++) {
      int d;
      cin >> d;
      b.push_back(d);
    }
    bool yes = 1;
    bool flag = 1;
    int i, j;
    for (i = 0, j = 0; i < n && j < m;) {
      yes = 0;
      while (i < n && a[i] == 0) {
        ans.push_back(0);
        yes = 1;
        k++;
        i++;
      }
      while (j < m && b[j] == 0) {
        yes = 1;
        ans.push_back(0);
        k++;
        j++;
      }
      while (i < n && a[i] <= k) {
        yes = 1;
        ans.push_back(a[i]);
        i++;
      }
      while (j < m && b[j] <= k) {
        yes = 1;
        ans.push_back(b[j]);
        j++;
      }
      while (i < n && a[i] == 0) {
        ans.push_back(0);
        yes = 1;
        k++;
        i++;
      }
      while (j < m && b[j] == 0) {
        yes = 1;
        ans.push_back(0);
        k++;
        j++;
      }
      while (i < n && a[i] <= k) {
        yes = 1;
        ans.push_back(a[i]);
        i++;
      }
      while (j < m && b[j] <= k) {
        yes = 1;
        ans.push_back(b[j]);
        j++;
      }
      if (yes == 0) {
        flag = 0;
        break;
      }
    }
    if (flag == 1 && i == n && j == m) {
      for (auto p : ans) cout << p << ' ';
      cout << '\n';
    } else
      cout << -1 << '\n';
  }
}
