#include <stdio.h>

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