using System;

namespace _3_zad_18_12
{
    class Program
    {
        static void Main(string[] args)
        {
            string b = Console.ReadLine();
            char[] a = b.ToCharArray();
            int br = 0;
            char pom;
            string unutra = "";
            int l = 0, d = 1, e = a.Length - 1;
            while (l < d && d < e)
            {
                Console.WriteLine("l:" + l + "d:" + d + "e:" + e);
                Console.WriteLine(a);
                if (a[l] == a[e])
                {
                    l++;
                    d++;  //aaab
                    e--;
                }
                else if (a[l] == a[d])
                {
                    pom = a[d];
                    a[d] = a[e];
                    a[e] = pom;

                }
                else if (a[d] == a[e])
                {
                    pom = a[l];
                    a[l] = a[d];
                    a[d] = pom;
                    d = l + 1;
                }
                else d++;
            }
        
            int pombr=0;
               for(int i = 0; i < b.Length; i++)
            {
                if (a[i] != b[i])
                {
                    pombr = i;
                    break;
                }
            }
            int pombrr=1;
            
            for (int i = b.Length-1; i >=0; i--)
            {
                if (a[i] != b[i])
                {
                    pombrr = i;
                    break;
                }
            }
            Console.WriteLine(pombr);
            Console.WriteLine(pombrr);
            Console.WriteLine(pombrr-pombr+1);
                Console.ReadKey();
            
        }
    }
}