function Main(s) {
  var ans = [-1, -1];
  if(s[0] === s[1]){
    console.log("1 2");
    return;
  }
  for(var i = 2; i < s.length; i++){
    if(s[i-2] === s[i]){
      ans = [i-1, i+1];
      break;
    }
    if(s[i-1] === s[i]){
      ans = [i, i+1];
      break;
    }
  }
  console.log(ans.join(" "));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());