#include <bits/stdc++.h>
using namespace std;
set<int> qs;
vector<int> res;
vector<int> vq;
signed main() {
  int t, n, q, prev_q, unknown;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    cin >> n;
    prev_q = -1;
    unknown = 0;
    qs.clear();
    res.clear();
    vq.clear();
    for (int j = 1; j <= n; ++j) {
      qs.insert(j);
    }
    for (int j = 0; j < n; ++j) {
      cin >> q;
      vq.push_back(q);
      if (q != prev_q) {
        qs.erase(q);
        res.push_back(q);
      } else {
        res.push_back(-1);
        unknown++;
      }
      prev_q = q;
    }
    for (int j = 0; j < n; ++j) {
      if (res[j] == -1) {
        if (vq[j] >= *qs.begin()) {
          res[j] = *qs.begin();
          qs.erase(qs.begin());
        } else {
          res.clear();
          res.push_back(-1);
          break;
        }
      }
    }
    for (int j : res) {
      cout << j << ' ';
    }
    cout << endl;
  }
}
