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