Score : $400$ points
Takahashi has $N$ balls. Each ball has an integer not less than $2$ written on it. He will insert them in a cylinder one by one. The integer written on the $i$-th ball is $a_i$.
The balls are made of special material. When $k$ balls with $k$ $(k \geq 2)$ written on them line up in a row, all these $k$ balls will disappear.
For each $i$ $(1 \leq i \leq N)$, find the number of balls after inserting the $i$-th ball.
Input is given from Standard Input in the following format:
$N$ $a_1$ $\ldots$ $a_N$
Print $N$ lines. The $i$-th line $(1 \leq i \leq N)$ should contain the number of balls after inserting the $i$-th ball.
5 3 2 3 2 2
1 2 3 4 3
The content of the cylinder changes as follows.
10 2 3 2 3 3 3 2 3 3 2
1 2 3 4 5 3 2 3 1 0