ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Алгоритмы и Структуры Данных > задача:


41. Finding Borders

Задачи сборника

• 33. Concert Tickets
• 34. Maximum Subarray Sum
• 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

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 4000/4000/4000/5000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Сложность Альфа


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.

Output

Print all border lengths of the string in increasing order.

Constraints
1≤n≤106

Example
Input:
abcababcab

Output:
2 5


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

www.contester.ru