main = do
    s <- getLine
    putStrLn $ unwords $ map show $ solve 1 s

solve :: Int -> [Char] -> [Int]
solve _ (_:[]) = [-1, -1]
solve i (a:b:[])
    | a == b = [i, i+1]
    | otherwise = [-1, -1]
solve i (a:b:c:xs)
    | a == b = [i, i+1]
    | a == c = [i, i+2]
    | otherwise = solve (i+1) (b:c:xs)