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 INF = 0x3f3f3f3f;
long long t, ans, k, n, m;
long long a[505];
long long b[505];
long long c[1005];
int main() {
  cin >> t;
  while (t--) {
    bool f = true;
    cin >> k >> n >> m;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= m; i++) cin >> b[i];
    int x = 1, y = 1;
    for (int i = 1; i <= n + m; i++) {
      if (k >= a[x] && x <= n) {
        if (a[x] == 0) {
          k++;
        }
        c[i] = a[x];
        x++;
        continue;
      }
      if (k >= b[y] && y <= m) {
        if (b[y] == 0) {
          k++;
        }
        c[i] = b[y];
        y++;
        continue;
      }
      if (k < a[x] && k < b[y]) {
        f = false;
        break;
      }
    }
    if (f == true) {
      for (int i = 1; i <= n + m; i++) {
        cout << c[i] << ' ';
      }
      cout << endl;
    } else {
      cout << -1 << endl;
    }
  }
  return 0;
}
