#include <bits/stdc++.h>
using namespace std;
const int kMax = 1e5 + 1;
char s[kMax];
int n, noSubstrings, z[kMax], ans[kMax];
void zAlgorithm() {
  int L = 0, R = 0;
  z[0] = n;
  for (int i = 1; i < n; ++i) {
    if (i > R) {
      L = R = i;
      while (R < n && s[R] == s[R - L]) ++R;
      --R;
      z[i] = R - L + 1;
    } else {
      int k = i - L;
      if (z[k] < R - i + 1)
        z[i] = z[k];
      else {
        L = i;
        while (R < n && s[R] == s[R - L]) ++R;
        --R;
        z[i] = R - L + 1;
      }
    }
  }
}
void findSubstrings() {
  for (int i = 0; i < n; ++i) {
    ++ans[z[i]];
    if (z[i] == n - i) ++noSubstrings;
  }
  for (int i = n - 1; i > 0; --i) ans[i] += ans[i + 1];
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  zAlgorithm();
  findSubstrings();
  printf("%d\n", noSubstrings);
  for (int i = n - 1; i >= 0; --i)
    if (z[i] == n - i) printf("%d %d \n", z[i], ans[z[i]]);
  return 0;
}
