#include <bits/stdc++.h>
using namespace std;
signed main() {
  int t;
  cin >> t;
  for (int afasdfk = 0; afasdfk < t; afasdfk++) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; cin >> a[i++])
      ;
    vector<int> p(n, -1);
    p[0] = a[0];
    set<int> setik;
    for (int i = 1; i <= n; i++) setik.insert(i);
    setik.erase(p[0]);
    for (int i = 1; i < n; i++) {
      if (a[i - 1] != a[i]) {
        setik.erase(a[i]);
        p[i] = a[i];
      }
    }
    for (int i = 0; i < n; i++) {
      if (p[i] == -1) {
        p[i] = *setik.begin();
        setik.erase(setik.begin());
      }
    }
    vector<int> my_p(n);
    my_p[0] = p[0];
    for (int i = 1; i < n; i++) my_p[i] = max(my_p[i - 1], p[i]);
    if (my_p != a) {
      cout << -1 << '\n';
    } else {
      for (auto e : p) cout << e << ' ';
      cout << '\n';
    }
  }
  return 0;
}
