Question
Frequency of the Current Value

You are given an array whose values are between 1 and K. For every index, print how many times the current value has appeared in the prefix ending at that index.

Input

The first line contains KaTeX can only parse string typed expression and KaTeX can only parse string typed expression. The second line contains KaTeX can only parse string typed expression integers.

Output

Print KaTeX can only parse string typed expression integers, one result for each index.

Example
Example:
Input
6 5

2 3 2 2 5 3
Output
1 1 2 3 1 2

Online