#include <bits/stdc++.h>
using namespace std;
char s[100002];
int b[100002];
int ans[100002];
int veces[100002];
int n;
void ver(int ar[]) {
  for (int i = 0; i <= n; i++) cout << ar[i] << " ";
  cout << endl << endl;
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  int i, j;
  i = 0;
  j = -1;
  b[i] = j;
  while (i < n) {
    while (j > -1 && s[i] != s[j]) j = b[j];
    i++, j++;
    veces[i] = 1;
    b[i] = j;
  }
  for (int i = n; i > 0; i--) veces[b[i]] += veces[i];
  int tam = 0;
  for (int i = b[n]; i > 0; i = b[i]) ans[tam++] = i;
  printf("%d\n", tam + 1);
  for (int i = tam - 1; i >= 0; i--) printf("%d %d\n", ans[i], veces[ans[i]]);
  printf("%d 1\n", n);
  return 0;
}
