object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val s = sc.next()
  s.toSeq.sliding(3).map(_.unwrap).zipWithIndex.find{ case (s, _) =>
    s(0) == s(1) || s(0) == s(2) || s(1) == s(2)
  } match {
    case Some((s, i)) => println(s"${i + 1} ${i + s.length}")
    case None => println("-1 -1")
  }
}
