14259 - 2024_IDS_Spring_Lab4_Finding Borders   

Description

A border of a string is a prefix that is also a suffix of the string but not the whole string. For example, the borders of abcababcab are ab and abcab.

Your task is to find all border lengths of a given string.

Input

The only input line has a string of length n consisting of characters a–z.

  • 1 ≤ n ≤ 106

Output

Print all border lengths of the string in increasing order.

Remember to print a ‘\n’ at the end of the output.

Do not include any spaces at the end of line.

Sample Input  Download

Sample Output  Download

Tags




Discuss