object Main {
  def main(args: Array[String]) {
    val sc = new java.util.Scanner(System.in)
    val s = sc.next
    val unb = findUnbalance(s)
    println(unb(0) + " " + unb(1))
  }
  def findUnbalance(s: String) =  {
    val N = s.length
    var unb = Array(-1, -1)
    for (i <- 0 until N-2) {
      val s1 = s(i)
      val s2 = s(i+1)
      val s3 = s(i+2)
      if (s1 == s2) unb = Array(i, i+1)
      if (s2 == s3) unb = Array(i+1, i+2)
      if (s1 == s3) unb = Array(i, i+2)
    }
    val u = unb
    u
  }

}