ABACABA Matching#6453

ABACABA Matching

1 second
128 megabytes
Easy

Consider a permutation of lowercase English letters: P = {p_1, p_2, ..., p_{26}}. Using P, you can generate the following sequence of strings:

S_1 = p_1

S_2 = S_1 + p_2 + S_1

S_3 = S_2 + p_3 + S_2

S_{26} = S_{25} + p_{26} + S_{25}

It is easy to show that the length of S_{26} is 2^{26} - 1 letters. The beginning of S_{26} looks like p_1 p_2 p_1 p_3 p_1 p_2 p_1 ...

You are given a string T consisting of lowercase English letters. For a fixed permutation P you can obtain S_{26} and then substitute some of the letters in T by other letters so that the resulting string becomes a substring of S_{26}. Your goal is to minimize the number of letters that you must replace in T by choosing the appropriate permutation P.

Input

The only line contains the string T (1 \leq |T| \leq 20000) consisting of lowercase English letters.

Output

On the first line, print the minimal number of letters that should be replaced. On the second line, print the position in string S_{26} where the resulting substring starts (indices start from ). On the third line, print the permutation P.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading