#include <stdio.h>

int main(){
  int N;
  int i;
  int ans=0;
  int tmp = 1;
  int count=0;
  scanf("%d",&N);
int A[N+1];
  for(i=0;i<N-1;i++){
    scanf("%d",&A[i]);
  }
  A[i] = 0;
  tmp = A[0];
  for(i=0;1;i++){
    if(A[i] == tmp && A[i] != 0) ans++;
    else if(A[i] != 0){
      printf("\n%d",ans);
      ans=1;  
      tmp=A[i];
      count++;
    }else{
      break;
    }
  }

for(i=count;i<N;i++){
  printf("\n0");
}
  return 0;
}

