Scanf.scanf "%s" (fun s ->
    let n = String.length s in
    let rec loop i =
        if i = n - 1 then -1, -1 else
            if i < n - 2 && s.[i] = s.[i + 2] then i + 1, i + 3 else
                if s.[i] = s.[i + 1] then i + 1, i + 2 else
                    loop (i + 1)
    in
    let a, b = loop 0 in
    Printf.printf "%d %d\n" a b
)