import std.stdio, std.string, std.conv;
import std.algorithm;

void main()
{
    for(string t; (t=readln().chomp()).length;)
    {
        immutable N = t.length;
        auto a = new int[26][N+1];
        int s=-1, e=-1;
        void solve()
        {
            foreach(int i,c;t)
            {
                immutable int n = c-'a';
                a[i+1]=a[i];
                a[i+1][n]++;
                foreach(int j;max(0,i-2)..i) if(a[i+1][n]-a[j][n]>(i+1-j)/2)
                {
                    s=j+1;
                    e=i+1;
                    return;
                }
            }
        }
        solve();
        writeln(s,' ',e);
    }
}