#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"s=input()\n"
"n=len(s)\n"
"for i in range(n-1):\n"
"  if s[i]==s[i+1]:\n"
"    print(i+1,i+2)\n"
"    break\n"
"  elif i<n-2 and s[i]==s[i+2]:\n"
"    print(i+1,i+3)\n"
"    break\n"
"else:\n"
"  print(-1,-1)\n"
"\"";
  system(s);
  return 0;
}            