fun main(arr:Array<String>) {
    val s = readLine()!!
    for(i in s.indices) {
        if(i + 1 <= s.lastIndex) {
            if(s[i] == s[i+1]) {
                println("%s %s".format(i+1,i+2))
                return
            }
            if(i+2 <= s.lastIndex) {
                if(s[i] == s[i+2]) {
                    println("%s %s".format(i+1,i+3))
                    return
                }
            }
        } else {
            break
        }
    }
    println("-1 -1")

}
