#Lutece1575. Hesty Str1ng Again

Hesty Str1ng Again

Migrated from Lutece 1575 Hesty Str1ng Again

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

A Palindrome string is a string which reads the same backward as forward, such as madam\texttt{madam} or racecar\texttt{racecar}

There is a problem about the palindrome string again.

You are given a pattern string SS with the length NN. For another string TT, we can define its similarity with SS by

$$Sim(T, S) = |\{(i,~j)~|~1 \leq i \leq j \leq N~\mathrm{and}~(T~+~S_{i \dots j})~\mathrm{is~a~palindrome~string}\}|, $$

where "SijS_{i \dots j}'' denotes the substring of SS from the position ii to jj and "++'' means the string concatenate operation.

Now, for a given string TT with the length MM, you need to calculate all its prefixes' similarity with SS, i.e., calculate

$Sim(T_{1 \dots 1}, S), Sim(T_{1 \dots 2}, S), \dots, Sim(T_{1 \dots M}, S)$.

Input

The first line contains a string TT.

The second line contains a sting SS.

1T,S1051 \leq |T|, |S| \leq 10^5, both TT and SS are composed by lowercase English characters.

Output

Print T|T| lines, for the ithi_{th} line, print Sim(T1i,S)Sim(T_{1 \dots i}, S).

Samples

aaba
aba
3
2
0
2

Resources

The 15th UESTC Programming Contest Final