import java.io.{BufferedReader, IOException, InputStream, InputStreamReader}
import java.util.StringTokenizer

import scala.collection.mutable
import scala.util.Sorting
import math.{min, max, abs}

object Main {
  def solve(): Unit = {
    val sc = new InputReader(System.in)
    val S = sc.next

    def two = (S zip S.drop(1)).zipWithIndex find { case ((c1, c2), _) => c1 == c2 }
    def three = (S zip S.drop(1) zip S.drop(2)).zipWithIndex find { case (((c1, c2), c3), _) => c1 == c2 || c1 == c3 || c2 == c3}

    val ans = (two map { case (_, i) =>
      s"${i + 1} ${i + 2}"
    }) orElse (three map { case (_, i) =>
      s"${i + 1} ${i + 3}"
    }) getOrElse "-1 -1"

    println(ans)
  }

  def main(args: Array[String]): Unit = {
    solve()
  }



  class InputReader(val stream: InputStream) {
    val reader = new BufferedReader(new InputStreamReader(stream), 32768)
    var tokenizer: StringTokenizer = null

    def next: String = {
      while (tokenizer == null || !tokenizer.hasMoreTokens)
        tokenizer = new StringTokenizer(reader.readLine)
      tokenizer.nextToken
    }

    def nextInt(): Int = next.toInt
    def nextLong(): Long = next.toLong
    def nextChar(): Char = next.charAt(0)
  }

}
