#include <bits/stdc++.h>
using namespace std;
char ch[100101];
int nxt[100101], l;
long long f[100101];
void kmp() {
  nxt[1] = 0;
  for (int i = 2, j = 0; i <= l; i++) {
    while (j > 0 && ch[i - 1] != ch[j]) j = nxt[j];
    if (ch[i - 1] == ch[j])
      nxt[i] = ++j;
    else
      nxt[i] = j;
  }
}
int ansa[100001], ansan;
void solve() {
  scanf("%s", ch);
  l = strlen(ch);
  kmp();
  for (int i = l; i; i--) {
    f[i]++;
    f[nxt[i]] += f[i];
  }
  for (int i = l; i; i = nxt[i]) ansa[++ansan] = i;
  printf("%d\n", ansan);
  for (int i = ansan; i; i--) printf("%d %lld\n", ansa[i], f[ansa[i]]);
}
int main() {
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
