import java.util.*

fun main(args:Array<String>){
    val s = readLine()!!
    for(i in 0 until s.length - 1){
        if(s[i] == s[i + 1]){
            println((i + 1).toString() + " " + (i + 2).toString())
            return
        }
    }
    for(i in 0 until s.length - 2){
        if(s[i] == s[i + 2]){
            println((i + 1).toString() + " " + (i + 3).toString())
            return
        }
    }
    println("-1 -1")
}
