import std.stdio, std.string, std.conv, std.array, std.range, std.algorithm;

void main() {
  long x;
  readf("%d\n", &x);
  long[] xs = readln.strip.split(" ").map!(to!long).array;

  long[] ans = [];
  bool flag = false;
  foreach (i; 1..x+1) {
    flag = false;
    foreach_reverse (j; 0..xs.length) {
      if (j+1 == xs[j]) {
        ans ~= j+1;
        xs = xs[0..j] ~ xs[j+1..$];
        flag = true;
        break;
      }
    }
    if (!flag) {
      break;
    }
  }
  if (flag) {
    foreach_reverse(a; ans) {
      writeln(a);
    }
  } else {
    writeln(-1);
  }
}
