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

alias Data = Tuple!(int, int);

void main() {
  auto S = readln.chomp;
  Data[char] data;
  foreach (i, s; S) {
    auto p = s in data;
    if (p) {
      (*p)[1]++;
      writeln((*p)[1]);
      if ((*p)[1] * 2 >= S.length) {
        writeln((*p)[0]+1, " ", i+1);
        return;
      }
    } else {
      Data d;
      d[0] = i;
      d[1] = 1;
      data[s] = d;
    }
  }
  writeln("-1 -1");
}
