fun main(args: Array<String>) {
    val s = readLine()!!

    if (s.length == 2 && s[0] == s[1]) {
        println("1 2")
        return
    }

    for (c in 'a'..'z') {
        for (i in 0 .. s.length - 3) {
            val m = s.substring(i, i + 3).count { it == c }
            if (m >= 2) {
                println("${i + 1} ${i + 3}")
                return
            }
        }
    }
    println("-1 -1")
}
