# #782. 新年的搜索记录

### 样例一

aacbc
2

#### output

2 3 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

#### explanation

$S=\texttt{aacbc},\ f(S)=\texttt{aacbccbc},\ f^2(S)=f(f(S))=\texttt{aacbccbcccbc}$。

### 数据范围：

$1$ $2 \times 10^5$ $1$ $20$
$2$ $100$ $8$ $20$
$3$ $2\,000$ $10^9$ $20$
$4$ $2 \times 10^5$ $20$
$5$ $6 \times 10^5$ $20$