Paw-Sealed Patrols
Gats the cat has a toy string with knots arranged in a row. The -th knot has color .
Gats may inspect any segment , where . The segment is paw-sealed when both of the following conditions hold:
- Among , the color occurs at exactly one position.
When , the single knot satisfies both conditions.
The variety of a segment is the number of distinct colors appearing in it. Let be the number of distinct colors in the entire toy string. For every satisfying , count the paw-sealed segments with variety exactly .
Input
The first line contains an integer (), the number of knots.
The second line contains integers (), representing the knot colors.
Output
Let be the number of distinct colors among all knots. Print integers on one line. The -th integer, for , must equal the number of paw-sealed segments whose variety is exactly .
Samples
Sample 1
Input
5 1 2 1 3 2
Output
5 4 2
There are , , and paw-sealed segments of varieties , , and , respectively. The two segments of variety are and .