import std.stdio, std.string, std.conv, std.array, std.algorithm, std.range, std.math;

void main()
{
    auto s = readln.chomp;

    char last = s[0];
    foreach (i, c; s[1..$]) {
        if (last == c) {
            writefln("%d %d", i+1, i+2);
            return;
        }
        last = c;
    }

    writeln("-1 -1");
}