#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n, m, f[111111], ls, good[111111], cnt[111111];
char s[111111];
void getfail() {
  f[0] = f[1] = 0;
  for (int i = 1; i < ls; ++i) {
    int j = f[i];
    while (s[j] != s[i] && j) j = f[j];
    f[i + 1] = s[j] == s[i] ? j + 1 : 0;
  }
}
int main() {
  int t, x, y, z, ca = 1;
  scanf("%s", (s));
  ls = strlen(s);
  getfail();
  int tot = 0;
  n = ls;
  int tem = n;
  while (n) tot++, good[n] = 1, n = f[n];
  n = tem;
  for (int i = (int)(1); i <= (int)(n); ++i) cnt[i] = 1;
  for (int i = n; i >= 1; --i) cnt[f[i]] += cnt[i];
  printf("%d\n", (tot));
  for (int i = (int)(1); i <= (int)(n); ++i) {
    if (good[i]) printf("%d %d\n", i, cnt[i]);
  }
  return 0;
}
