SP9012 MAXMATCH - Maximum Self-Matching
Description
You're given a string **s** consisting of letters 'a', 'b' and 'c'.
The matching function m **$ _{s} $** ( i ) is defined as the number of matching characters of **s** and its i-shift. In other words, m **$ _{s} $** ( i ) is the number of characters that are matched when you align the 0-th character of **s** with the i-th character of its copy.
You are asked to compute the maximum of m **$ _{s} $** ( i ) for all i ( 1
Input Format
The first and only line of input contains the string **s**. 2
Output Format
The first line of output contains the maximal m **$ _{s} $** ( i ) over all i.
The second line of output contains all the i's for which m $ _{s} $ ( i ) reaches maximum.