Given a string, calculate for each position the length of the longest palindrome that ends at that position.
The only line contains a string of length $n$ . Each character is one of a–z.
Print $n$ numbers: the length of each palindrome.
ababbababaa \n
ababbababaa
\n
1 1 3 3 2 4 6 8 5 5 2 · · · · · · · · · · \n
1 1 3 3 2 4 6 8 5 5 2
· · · · · · · · · · \n