#include<iostream>
#include<cstring>
using namespace std;
char s[100000+10];
int flag=0;

int main(){
	cin>>s;
	for (int i=1;i<strlen(s);i++)
		if (s[i]==s[i-1]){
			flag=1;
			cout<<i<<" "<<i+2<<endl;
		}
	if (flag==0) cout<<"-1"<<" "<<"-1"<<endl;
}