#include<bits/stdc++.h>
using namespace std;

int main(){
	int a = -1,b = -1;
	char s[1000004];
	scanf("%s",s);
	
	for(int i  = 0; i < strlen(s); i++){
		if(s[i] == s[i+1] ){
			a = i + 1 ;
			b = i + 2;
			break;
		}
		if(s[i] == s[i+2]){
			a = i + 1;
			b = i + 3;
			break ;
		}
	}
	
	cout << a << " " << b << "\n";
	return 0;
}