
program main
  implicit none
  character(10**5)::S
  integer::i
  read*,S
  do i=1,len_trim(S)-1
    if(S(i:i)==S(i+1:i+1))then
      print"(i0,A,i0)",i," ",i+1
      stop
    endif
  end do
  do i=1,len_trim(S)-2
    if(S(i:i)==S(i+2:i+2))then
      print"(i0,A,i0)",i," ",i+2
      stop
    endif
  end do
  print"(i0,A,i0)",-1," ",-1
end program main