Blocks of string#1309

Blocks of string

1 second
128 megabytes
Very easy

The block of a string at position is defined as the largest substring starting at position that matches a prefix of . The length of the block at position is considered to be zero.

Find the lengths of the blocks of string for all positions.

Input

One string (|S| \le 10^6).

Output

Print a single line containing the lengths of the blocks of string for all positions.

Examples

Example 1

Loading
Loading