#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  ll N;
  ll count=1;
  cin>>N;
  vector<ll> vec(N-1);
  for(ll i=1;i<N;i++){
    cin>>vec.at(i-1);
  }
  for(ll j=1;j<=N-2;j++){
    if(vec.at(j)==vec.at(j-1)){count++;}
    if(vec.at(j)!=vec.at(j-1)){cout<<count<<endl;count=1;}
    if(vec.at(j)!=vec.at(j-1)+1 && vec.at(j)!=vec.at(j-1)){for(ll a=1;a<vec.at(j)-vec.at(j-1);a++)cout<<0<<endl;}
  }
  cout<<count<<endl;
  for(ll k=1;k<=N-vec.at(N-2);k++){
  cout<<0<<endl;
  }
}