object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val s = sc.next()
  if (s.length == 2) {
    if (s(0) == s(1)) {
      println("1 2")
    } else {
      println("-1 -1")
    }
  } else {
    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")
    }
  }
}
