#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1e5, MaxM = 2e5;
int n, all, nxt[MaxN + 5], size[MaxN + 5], q[MaxN + 5];
int pre[MaxM + 5], last[MaxN + 5], other[MaxM + 5];
char s[MaxN + 5];
void Kmp(char s[]) {
  nxt[0] = -1;
  int t = -1;
  for (int i = 1; i < n; i++) {
    while (t > -1 && s[t + 1] != s[i]) t = nxt[t];
    if (s[t + 1] == s[i])
      nxt[i] = ++t;
    else
      nxt[i] = t;
  }
}
void Build(int x, int y) {
  pre[++all] = last[x];
  last[x] = all;
  other[all] = y;
}
void Dfs(int x, int fa) {
  int ed = last[x], dr;
  size[x] = 1;
  while (ed != -1) {
    dr = other[ed];
    if (dr != fa) {
      Dfs(dr, x);
      size[x] = size[x] + size[dr];
    }
    ed = pre[ed];
  }
}
void Solve() {
  int t = nxt[n - 1];
  q[1] = n - 1;
  q[0] = 1;
  while (t != -1) {
    q[++q[0]] = t;
    t = nxt[t];
  }
  all = -1;
  memset(last, -1, sizeof(last));
  for (int i = 0; i < n; i++) Build(nxt[i] + 1, i + 1);
  Dfs(0, -1);
  printf("%d\n", q[0]);
  for (int i = q[0]; i >= 1; i--) printf("%d %d\n", q[i] + 1, size[q[i] + 1]);
}
int main() {
  while (~scanf("%s", s)) {
    n = strlen(s);
    Kmp(s);
    Solve();
  }
  return 0;
}
