let array_of_string s = Array.init (String.length s) (fun i -> s.[i])

let () =
  try
    read_line ()
    |> array_of_string
    |> (fun a -> Array.init (Array.length a - 1) (fun i -> (i, a.(i), a.(i + 1))))
    |> Array.to_list
    |> List.find (fun (_, a, b) -> a = b)
    |> (fun (i, _, _) -> Printf.printf "%d %d\n" (i + 1) (i + 2))
  with Not_found -> print_endline "-1 -1"