#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;
    vector<int> v(n);
    vector<int> res(n);
    vector<bool> lst(n);
    vector<int> pos;
    int k = 0;
    cin >> v[0];
    res[0] = v[0];
    lst[v[0] - 1] = true;
    for (int j = 1; j < n; j++) {
      cin >> v[j];
      if (v[j] != v[j - 1]) {
        res[j] = v[j];
        lst[v[j] - 1] = true;
      }
    }
    for (int j = 0; j < n; j++) {
      if (!lst[j]) {
        pos.push_back(j);
      }
    }
    bool flag = false;
    for (int j = 0; j < n; j++) {
      if (res[j] != 0) {
        continue;
      }
      if (res[j] == 0) {
        if (pos[k] + 1 < v[j]) {
          res[j] = pos[k] + 1;
          k++;
        }
        if (res[j] == 0) {
          flag = true;
          j = n;
        }
      }
    }
    if (flag) {
      cout << -1 << endl;
      continue;
    }
    for (int j = 0; j < n; j++) {
      cout << res[j] << ' ';
    }
    cout << endl;
  }
  return 0;
}
