#include<bits/stdc++.h>
using namespace std;
 
int main() {
  int N; cin >> N;
  vector<int> v(N);
  for (int i = 0; i < N; i++) cin >> v[i];
  vector<int> r(N);
  for (int i = N-1; i >= 0; i--) {
    int p = -1;
    for (int j = 0; j < v.size(); j++) {
      if (v[j] == j+1) p = j;
    }
    if (p == -1) {
      cout << -1 << endl; return 0;
    }
    r[i] = p+1;
    v.erase(v.begin()+p);
  }
  for (int i = 0; i < N; i++) cout << r[i] << endl;
}