#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a;
  cin >> n;
  vector<long long> v;
  vector<long long> hash(2 * n, 0);
  for (long long i = 0; i < n; i++) {
    cin >> a;
    v.push_back(a);
    hash[a] = 1;
  }
  vector<long long> vec(n, -1);
  for (int i = 1; i < n; i++) {
    if (v[i] != v[i - 1]) vec[i] = v[i - 1];
  }
  int j = 0;
  for (int i = 0; i < n; i++) {
    if (vec[i] == -1) {
      while (hash[j] == 1) j++;
      vec[i] = j;
      j++;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << vec[i] << " ";
  }
  cout << endl;
}
