import std.stdio;
import std.string, std.conv, std.array, std.algorithm;
import std.uni, std.math, std.container;
import core.bitop, std.datetime;

void main(){
    auto s = readln.chomp;
    auto n = s.length.to!int;

    if(n == 2){
        if(s[0] == s[1]){
            writeln(1, " ", 2);
            return;
        } else {
            writeln(-1, " ", -1);
            return;
        }
    }

    foreach(i ; 0 .. n - 2){
        if(s[i] == s[i + 1]){
            writeln(i+1, " ", i + 2);
            return;
        } else if(s[i + 1] == s[i + 2]){
            writeln(i+2, " ", i+3);
            return;
        } else if(s[i] == s[i + 2]){
            writeln(i+1, " ", i+3);
            return;
        }
    }

    writeln(-1, " ", -1);

}