#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n;
char s[N];
int nxt[N], cnt[N], ans[N], tot;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 2, j = 0; i <= n; i++) {
    while (j && s[i] != s[j + 1]) j = nxt[j];
    if (s[i] == s[j + 1]) j++;
    nxt[i] = j;
  }
  for (int i = 1; i <= n; i++)
    if (nxt[i]) cnt[nxt[i]]++;
  for (int i = n - 1; i >= 1; i--) cnt[nxt[i]] += cnt[i];
  for (int i = 1; i <= n; i++) cnt[i]++;
  ans[++tot] = n;
  for (int i = nxt[n]; i; i = nxt[i]) ans[++tot] = i;
  printf("%d\n", tot);
  for (int i = tot; i >= 1; i--) printf("%d %d\n", ans[i], cnt[ans[i]]);
  return 0;
}
