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;
using ll = long long;
const int MAXN = 2e5 + 5;
const int MAXPRIME = 3 * 1e7 + 5;
const int inf = 1e9;
const ll INF = 1e18;
const int M = 1e9 + 7;
void YES();
void NO();
int k, n, m, a[105], b[105], ans[505];
void solve() {
  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 pos = 1, pos1 = 1, pos2 = 1;
  for (int i = 1; i <= n + m; ++i) {
    if (pos1 > n) {
      for (int j = pos2; j <= m; ++j) {
        if (!b[j])
          ans[pos] = b[j], pos++, k++;
        else if (b[j] > k) {
          cout << "-1\n";
          for (int i = 1; i <= n + m; ++i) ans[i] = 0;
          return;
        } else
          ans[pos] = b[j], pos++;
      }
      break;
    } else if (pos2 > m) {
      for (int j = pos1; j <= n; ++j) {
        if (!a[j])
          ans[pos] = a[j], pos++, k++;
        else if (a[j] > k) {
          cout << "-1\n";
          for (int i = 1; i <= n + m; ++i) ans[i] = 0;
          return;
        } else
          ans[pos] = a[j], pos++;
      }
      break;
    } else if (!a[pos1])
      ans[pos] = a[pos1], pos++, pos1++, k++;
    else if (!b[pos2])
      ans[pos] = b[pos2], pos++, pos2++, k++;
    else if (min(a[pos1], a[pos2]) > k) {
      cout << "-1\n";
      for (int i = 1; i <= n + m; ++i) ans[i] = 0;
      return;
    } else {
      if (a[pos1] > b[pos2])
        ans[pos] = b[pos2], pos++, pos2++;
      else
        ans[pos] = a[pos1], pos++, pos1++;
    }
  }
  for (int i = 1; i <= n + m; ++i) {
    cout << ans[i] << ' ';
    ans[i] = 0;
  }
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  int tt = 1;
  cin >> tt;
  for (int i = 1; i <= tt; ++i) {
    solve();
  }
  return 0;
}
void YES() { cout << "YES\n"; }
void NO() { cout << "NO\n"; }
