import std.stdio, std.string;

void main(){
 auto s=readln.chomp;
 foreach(i;0..s.length-1)if(s[i]==s[i+1]){
writeln(i+1," ",i+2);
return;
}
foreach(i;0..s.length-2)if(s[i]==s[i+2]){
writeln(i+1," ",i+3);
return;
}
writeln("-1 -1");
}