#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;

int main(){
    string s;
    cin>>s;
    int a=-1,b=-1,n=s.size();
    rep(i,n-1){
        if(s[i]==s[i+1])a=i+1,b=i+2;
    }
    rep(i,n-2){
        if(s[i]==s[i+2])a=i+1,b=i+3;
    }
    cout<<a<<" "<<b<<endl;
    return 0;
}