#include <bits/stdc++.h>
const int maxn = 100005;
int p[maxn], cnt, a[maxn], f[maxn];
char s[maxn];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  p[1] = 0;
  int j = 0;
  for (int i = 2; i <= n; ++i) {
    while (j && s[j + 1] != s[i]) j = p[j];
    if (s[j + 1] == s[i]) ++j;
    p[i] = j;
  }
  j = n;
  while (j) {
    f[j]++;
    ++cnt;
    j = p[j];
  }
  for (int i = n; i >= 1; --i) a[p[i]]++;
  for (int i = n; i >= 1; --i) a[p[i]] += a[i];
  printf("%d\n", cnt);
  for (int i = 1; i <= n; ++i)
    if (f[i]) printf("%d %d\n", i, a[i] + 1);
  return 0;
}
