program ABC043D
    implicit none
    integer(8)::i
    integer(8)::flg=0
    character(100000)::s
    read(5,*)s

    do i=1,len_trim(s)-1
        if(s(i:i)==s(i+1:i+1))then
            flg=1
            print'(i0,1x,i0)',i,i+1
            exit
        else if(i<=len_trim(s)-2)then
            if(s(i:i)==s(i+2:i+2))then
                flg=1
                print'(i0,1x,i0)',i,i+2
                exit
            end if
        end if
    end do

    if(flg==0)then
        print'(i0,1x,i0)',-1,-1
    end if
end program ABC043D