#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"input();a=['']\n"
"for i in input().split():a.insert(int(i)-1,i)\n"
"print(*a[-1]and[-1]or a)\n"
"\"";
  system(s);
  return 0;
}            