import std.stdio;

void main(){
	auto cin = new Cin();
	
	auto S = cin.line!string()[0];
	
	bool succeed = false;
	
	
	foreach( i ; 0..S.length-1 ){
		if( S[i]==S[i+1] ){
			writeln( i+1," ",i+2 );
			return;
		}
	}
	foreach( i ; 0..S.length-2 ){
		if( S[i]==S[i+2] ){
			writeln( i+1," ",i+3 );
			return;
		}
	}
	writeln( "-1 -1" );
	return;
}
auto solve(){
}
unittest{
	
}


import std.stdio,std.conv,std.string;
import std.algorithm,std.array,std.math;

class Cin
{
	T[] line( T = size_t , string token = " " )( size_t m = 1 ){
		T[] arr = [];
		foreach( i ; 0..m ){
			arr ~= this.read!T();
		}
		return arr;
	}
	T[][] rect( T = size_t , string token = " " )( size_t m = 1 ){
		T[][] arr = new T[][](m);
		foreach( i ; 0..m ){
			arr[i] = this.read!T(token);
		}
		return arr;
	}
	private T[] read( T = size_t )( string token = " " ){
		T[] arr;
		foreach( elm ; readln().chomp().split(token) ){
			arr ~= elm.to!T();
		}
		return arr;
	}
}

pure T[] span(T)( in T begein , in T end , in T step = 1 ){
	assert( begin < end );
	assert( 0 < step );
	T[] arr;
	for( T i = begein ; i < end ; i += step ){
		arr ~= i;
	}
	return arr;
}

pure T[] map(T)( ref T[] args , T delegate(T)  dlg ){
	foreach( ref arg ; args ){
		arg.dlg();
	}
	return args;
}
pure T sum(T)( in T[] args ){
	T result = 0;
	foreach( arg ; args ){
		result += arg;
	}
	debug writeln( args , "\n" , arg );
	return result;
}
pure T ave(T)( in T[] args ){
	return args.sum()/args.length;
}
