#include <bits/stdc++.h>
const double eps = 1e-8, pi = acos(-1.0);
const int maxS = 1e6 + 13;
const int maxT = 1e2 + 13;
const long long MOD = 1e9 + 7;
using namespace std;
struct point {
  int to, id;
};
struct edge {
  int from, to;
};
void read(int &x) { scanf("%d", &x); }
void read(int &x, int &y) { scanf("%d%d", &x, &y); }
int n, m, i, j, k, x, y, z, S, T, ii, s, t, l, r, pos, len;
int tot = 0, ans = 0, kase = 0, cnt = 0;
bool flag = false;
char s1[maxS], s2[maxS];
char ch;
int f[maxS], dp[maxS];
bool chk[maxS];
void getNext(char *T) {
  memset(f, 0, sizeof(f));
  int i, j = 0, len = strlen(T);
  for (i = 1; i < len; i++) {
    while (j && T[i] != T[j]) j = f[j];
    if (T[i] == T[j]) f[i + 1] = ++j;
  }
}
int main() {
  scanf("%s", s1);
  getNext(s1);
  len = n = strlen(s1);
  while (n) {
    chk[n] = true;
    n = f[n];
    cnt++;
  }
  for (i = len; i; i--) {
    dp[i]++;
    dp[f[i]] += dp[i];
  }
  printf("%d\n", cnt);
  for (i = 1; i <= len; i++)
    if (chk[i]) printf("%d %d\n", i, dp[i]);
  return 0;
}
