import std.stdio, std.string,std.range, std.conv, std.array, std.algorithm, std.math, std.typecons, std.functional, std.bigint, std.random;

void main() {
  auto S = readln.chomp;
  if (S[0] == S[1]) {
    writeln("1 2");
    return;
  }
  foreach (i; 0..S.length-2) {
    if (S[i] == S[i+1] || S[i+1] == S[i+2] || S[i+2] == S[i]) {
      writeln(i+1, " ", i+3);
      return;
    }
  }
  writeln("-1 -1");
}
