PROGRAM ATCODER
implicit none
character(len=10**5) :: s
integer :: i, len

read(*,*) s

len = len_trim(s)

do i = 1, len
	if(s(i:i) == s(i+1:i+1))then
    	print'(i0," ",i0)', i, i+1
        stop
    end if
    if(s(i:i) == s(i+2:i+2))then
    	print'(i0," ",i0)', i, i+2
        stop
    end if
end do

print'(i0," ",i0)', -1,-1

END PROGRAM ATCODER