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() {
  int t;
  cin >> t;
  while (t--) {
    int k, n, m;
    cin >> k >> n >> m;
    int a[n + m];
    int count = 0, max = 0;
    for (int i = 0; i < n + m; i++) {
      cin >> a[i];
      if (a[i] == 0) count++;
      if (a[i] >= max) max = a[i];
    }
    sort(a, a + n + m);
    if (count + k < max)
      cout << "-1";
    else {
      for (int i = count; i < n + m; i++) {
        while (a[i] > k) {
          cout << "0 ";
          k++;
        }
        if (a[i] <= k) {
          cout << a[i] << " ";
        }
      }
    }
    cout << "\n";
  }
  return 0;
}
