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