fun main() {
    val s = readLn()

    if (s.length == 2) println(if (s[0] == s[1]) "1 2" else "-1 -1")
    else {
        for (i in 0 until s.length - 2) {
            if (setOf(s[i], s[i + 1], s[i + 2]).size < 3) {
                println("${i + 1} ${i + 3}")
                return
            }
        }
        println("-1 -1")
    }
}

// Input Reader
private fun readLn() = readLine()!!
