main :: IO ()

main = do
    s <- getLine :: IO String
    let ans = solve $ s
    let result = if fst ans == snd ans then (-1,-1) else ans
    putStr $ show $ fst result
    putStr " "
    putStr $ show $ snd result

solve :: String -> (Int,Int)
solve (x:xs) =
    if length xs == 0
        then
            (-1,-1)
        else
            if x == xs !! 0
                then
                    (1,2)
            else if length xs >= 2 && x == xs !! 1
                then
                    (1,3)
                else
                    (1 + fst t,1 + snd t)
                        where
                            t = solve xs
                    