let () =
  Scanf.scanf "%s" @@ fun s ->
  let len = String.length s in 
  let rec loop idx =
    if idx >= len-1 then None
    else if idx+2 <= len && s.[idx] = s.[idx+1] then Some (idx+1, idx+2)
    else if idx+3 <= len && s.[idx] = s.[idx+2] then Some (idx+1, idx+3)
    else loop (idx+1)
  in
  match loop 0 with
  | None -> print_endline "-1 -1"
  | Some (s, t) -> Printf.printf "%d %d\n" s t