#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, mx = -1;
  cin >> n;
  vector<int> vec(n), res(n), done(n + 1);
  for (auto &v : vec) {
    cin >> v, done[v]++, mx = max(mx, v);
  }
  if (mx != n) {
    cout << -1;
    return;
  }
  for (int i = 1; i <= n; i++) {
    if (done[i] > i) {
      cout << -1;
      return;
    }
  }
  res[0] = vec[0], done.clear(), done[vec[0]]++;
  for (int i = 1, mx = vec[0], cur = vec[0]; i < vec.size(); i++) {
    if (mx < vec[i]) {
      mx = vec[i], cur = vec[i];
      res[i] = vec[i], done[vec[i]]++;
    } else {
      for (; done[cur]; --cur)
        ;
      if (cur == 0) {
        cout << -1;
        return;
      }
      res[i] = cur, done[cur]++;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << res[i] << " ";
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve(), cout << endl;
  }
  return 0;
}
