#include <bits/stdc++.h>
using namespace std;
int a[105],b[105];
int N;
int main()
{
	scanf("%d",&N);
	int cnt=N;
	for (int i=1;i<=N;i++)
	  scanf("%d",&a[i]);
	for (int i=cnt;i>=1;i--)
	  {
	  	for (int j=N;j>=1;j--)
	  		//cout<<j<<endl;
	  	    if (a[j]==j)
	  	     {
			  	for (int k=j;k<=N-1;k++)
			  	  a[k]=a[k+1];
			  	a[N]=0;
			  	b[i]=j;
			  	N--;
			  	break;
		    }
        }
 	if (N!=0) printf("-1");
 	else 
	 for (int i=1;i<=cnt;i++)
 	   printf("%d\n",b[i]);    
	return 0;
}