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;
const int N = 310;
int a[N], b[N];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int k, m, n;
    cin >> k >> m >> n;
    int res = 0, res1 = 0, res2 = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == 0) res1++;
    }
    sort(a, a + n);
    for (int i = 0; i < m; i++) {
      cin >> b[i];
      if (b[i] == 0) res2++;
    }
    sort(b, b + n);
    int x = max(a[n - 1], b[m - 1]);
    res = res1 + res2;
    if (x > res + k)
      cout << -1 << endl;
    else {
      for (int i = 0; i < res1; i++) cout << a[i] << ' ';
      for (int i = 0; i < res2; i++) cout << b[i] << ' ';
      for (int i = res1; i < n; i++) cout << a[i] << ' ';
      for (int i = res2; i < m; i++) cout << b[i] << ' ';
      cout << endl;
    }
  }
}
