
import java.util.Scanner

import scala.annotation.tailrec

object Main extends App {
  val sc = new Scanner(System.in)
  val str = sc.next
  val cs = str.toCharArray.toList.zipWithIndex

  @tailrec
  def solve(cs: List[(Char, Int)]): (Int, Int) = cs match {
    case f :: _ :: t :: _ if f._1 == t._1 => (f._2 + 1, t._2 + 1)
    case f :: s :: _ if f._1 == s._1 => (f._2 + 1, s._2 + 1)
    case _ :: s :: rest => solve(s :: rest)
    case _ => (-1, -1)
  }
  val t = solve(cs)
  val ans = s"${t._1} ${t._2}"
  println(ans)
}
