#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define all(a) (a).begin(),(a).end()
#define rep(i,j) for(ll i=0;i<j;i++)
#define repf(i,m,j) for(ll i=m;i<j;i++)
#define pb push_back
#define sort(a) sort(all(a))
int main()
{
	vector<int> a(100);
	vector<int> b(100);
	int N;
	int num;
	cin>>N;
	rep(i,N)scanf("%d",&b[i]);
	rep(i,N){
		if(i+1>=b[i]) a.insert(a.begin()+b[i]-1,b[i]);
		else{
			printf("%d\n",-1); return EXIT_SUCCESS;	
		}
	}
	rep(i,N) printf("%d\n",a[i]);
}