#include <bits/stdc++.h>
using namespace std;
long long q, n, a[100004], mn, mx, inx, inn, sz, c[100004];
map<long long, long long> mp;
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    mp[a[i]] = 1;
  }
  mn = 1;
  for (long long i = 1; i <= n; i++) {
    if (a[i] != a[i - 1]) {
      c[i] = a[i - 1];
    } else {
      while (mp[mn] == 1) {
        mn++;
      }
      c[i] = mn++;
    }
  }
  for (long long i = 1; i <= n; i++) {
    cout << c[i] << " ";
  }
}
