Jumps#2738

Jumps

2 seconds
256 megabytes
Easy

Skipper and Private enjoy jumping on ice floes. One day, they arranged a sequence of ice floes on the water, each painted in colors. Skipper loves jumping across these ice floes, but Private is quite particular — he only enjoys jumping over a segment of ice floes if, when jumping back and forth, the sequence of colors remains the same in both directions (i.e., the segment is a palindrome).

Input

The input consists of a single line of length (1 \leq N \leq 10^5) representing the colors of the ice floes in order of increasing numbers. The line is composed of lowercase Latin letters, where different letters represent different colors and identical letters represent the same color. The line ends with a newline character.

Output

Output a single line containing non-negative integers a_i, where each a_i is the length of the first segment that Private will not want to jump over starting at position .

Examples

Example 1

Loading
Loading