main :: IO()
main = do
    s <- getLine
    let ans = solve s 0
    putStrLn $ show (fst ans) ++ " " ++ show (snd ans)

solve :: String -> Int -> (Int,Int)
solve str num
    | length str < 2			= (-1, -1)
    | str !! 0 == str !! 1		= (num + 1, num + 2)
    | length str < 3 			= (-1, -1)
    | str !! 0 == str !! 2		= (num + 1, num + 3)
    | otherwise					= solve (tail str) (succ num)