function Main(input) {
  input = input.split("\n");
  var s = input[0];
  alf = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
  var ans ="-1 -1";
  var start = -1;
  var end = -1;
  for(i=0;i<s.length;i++){
    for(j=i+1;j<s.length;j++){
      for(k=0;k<26;k++){
        var reg = new RegExp(alf[k],"g");
        if((s.slice(i,j+1)).match(reg)!=null){
          if((((s.slice(i,j+1)).match(reg))).length*2>j+1){
            start=i+1;
            end=j+1;
            ans=start + " " + end;
            break;
          }
        }
      }
      if(ans!="-1 -1"){
        break;
      }
    }
    if(ans!="-1 -1"){
      break;
    }
  }

  console.log('%s', ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));