Language: C++

process.stdin.resume();
process.stdin.setEncoding('ascii');

var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;

process.stdin.on('data', function (data) {
    input_stdin += data;
});

process.on('SIGINT', function(){
    input_stdin_array = input_stdin.split("\n");
    main();
    process.exit();
});

process.stdin.on('end', function () {
    input_stdin_array = input_stdin.split("\n");
    main();    
});

function readLine() {
    return input_stdin_array[input_currentline++];
}

/////////////// ignore above this line ////////////////////

function main() {
	var s = readLine();	
	
	
	for (var i=0; i + 1 < s.length; i++){
		if (s[i] == s[i+1]){
			console.log((i+1).toString() + " " + (i+2).toString());
			return;
		}
	}
	for (var i=0; i + 2 < s.length; i++){
		if (s[i] == s[i+2]){
			console.log((i+1).toString() + " " + (i+3).toString());
			return;
		}
	}
	
	console.log("-1 -1");
}process.stdin.resume();
process.stdin.setEncoding('ascii');

var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;

process.stdin.on('data', function (data) {
    input_stdin += data;
});

process.on('SIGINT', function(){
    input_stdin_array = input_stdin.split("\n");
    main();
    process.exit();
});

process.stdin.on('end', function () {
    input_stdin_array = input_stdin.split("\n");
    main();    
});

function readLine() {
    return input_stdin_array[input_currentline++];
}

/////////////// ignore above this line ////////////////////

function main() {
	var s = readLine();	
	
	
	for (var i=0; i + 1 < s.length; i++){
		if (s[i] == s[i+1]){
			console.log((i+1).toString() + " " + (i+2).toString());
			return;
		}
	}
	for (var i=0; i + 2 < s.length; i++){
		if (s[i] == s[i+2]){
			console.log((i+1).toString() + " " + (i+3).toString());
			return;
		}
	}
	
	console.log("-1 -1");
}

Compiler output:
a.cc:2:27: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    2 | process.stdin.setEncoding('ascii');
      |                           ^~~~~~~
a.cc:8:18: warning: multi-character character constant [-Wmultichar]
    8 | process.stdin.on('data', function (data) {
      |                  ^~~~~~
a.cc:12:12: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   12 | process.on('SIGINT', function(){
      |            ^~~~~~~~
a.cc:18:18: warning: multi-character character constant [-Wmultichar]
   18 | process.stdin.on('end', function () {
      |                  ^~~~~
a.cc:48:27: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   48 | process.stdin.setEncoding('ascii');
      |                           ^~~~~~~
a.cc:54:18: warning: multi-character character constant [-Wmultichar]
   54 | process.stdin.on('data', function (data) {
      |                  ^~~~~~
a.cc:58:12: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   58 | process.on('SIGINT', function(){
      |            ^~~~~~~~
a.cc:64:18: warning: multi-character character constant [-Wmultichar]
   64 | process.stdin.on('end', function () {
      |                  ^~~~~
a.cc:1:1: error: 'process' does not name a type
    1 | process.stdin.resume();
      | ^~~~~~~
a.cc:2:1: error: 'process' does not name a type
    2 | process.stdin.setEncoding('ascii');
      | ^~~~~~~
a.cc:4:1: error: 'var' does not name a type
    4 | var input_stdin = "";
      | ^~~
a.cc:5:1: error: 'var' does not name a type
    5 | var input_stdin_array = "";
      | ^~~
a.cc:6:1: error: 'var' does not name a type
    6 | var input_currentline = 0;
      | ^~~
a.cc:8:1: error: 'process' does not name a type
    8 | process.stdin.on('data', function (data) {
      | ^~~~~~~
a.cc:10:2: error: expected unqualified-id before ')' token
   10 | });
      |  ^
a.cc:12:1: error: 'process' does not name a type
   12 | process.on('SIGINT', function(){
      | ^~~~~~~
a.cc:16:2: error: expected unqualified-id before ')' token
   16 | });
      |  ^
a.cc:18:1: error: 'process' does not name a type
   18 | process.stdin.on('end', function () {
      | ^~~~~~~
a.cc:21:2: error: expected unqualified-id before ')' token
   21 | });
      |  ^
a.cc:23:1: error: 'function' does not name a type; did you mean 'union'?
   23 | function readLine() {
      | ^~~~~~~~
      | union
a.cc:29:1: error: 'function' does not name a type; did you mean 'union'?
   29 | function main() {
      | ^~~~~~~~
      | union
a.cc:47:2: error: 'process' does not name a type
   47 | }process.stdin.resume();
      |  ^~~~~~~
a.cc:48:1: error: 'process' does not name a type
   48 | process.stdin.setEncoding('ascii');
      | ^~~~~~~
a.cc:50:1: error: 'var' does not name a type
   50 | var input_stdin = "";
      | ^~~
a.cc:51:1: error: 'var' does not name a type
   51 | var input_stdin_array = "";
      | ^~~
a.cc:52:1: error: 'var' does not name a type
   52 | var input_currentline = 0;
      | ^~~
a.cc:54:1: error: 'process' does not name a type
   54 | process.stdin.on('data', function (data) {
      | ^~~~~~~
a.cc:56:2: error: expected unqualified-id before ')' token
   56 | });
      |  ^
a.cc:58:1: error: 'process' does not name a type
   58 | process.on('SIGINT', function(){
      | ^~~~~~~
a.cc:62:2: error: expected unqualified-id before ')' token
   62 | });
      |  ^
a.cc:64:1: error: 'process' does not name a type
   64 | process.stdin.on('end', function () {
      | ^~~~~~~
a.cc:67:2: error: expected unqualified-id before ')' token
   67 | });
      |  ^
a.cc:69:1: error: 'function' does not name a type; did you mean 'union'?
   69 | function readLine() {
      | ^~~~~~~~
      | union
a.cc:75:1: error: 'function' does not name a type; did you mean 'union'?
   75 | function main() {
      | ^~~~~~~~
      | union