HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Algorithms and Data Structures > problem:


43. Finding Periods

Volume problems

• 35. Stick Lengths
• 36. Missing Coin Sum
• 37. Collecting Numbers
• 38. Playlist
• 39. Towers
• 40. Traffic Lights
• 41. Finding Borders
• 42. Money Sums
• 43. Finding Periods
• 44. Minimal Rotation
• 45. Static Range Sum Queries
• 01. Автобус в Джал
• 03. Новый язык программирования
• 05. Trailing Zeros
• 17. Number Spiral
• 23. Apple Division
• 25. Josephus Queries

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 4000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Difficulty Alpha


A period of a string is a prefix that can be used to generate the whole string by repeating the prefix. The last repetition may be partial. For example, the periods of abcabca are abc, abcabc and abcabca.

Your task is to find all period lengths of a string.

Input

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

Output

Print all period lengths in increasing order.

Constraints
1≤n≤106

Example
Input:
abcabca

Output:
3 6 7


Для отправки решений необходимо выполнить вход.

www.contester.ru