#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int cnt, T[maxn];
char str[maxn];
struct node {
  int len, tim;
} ans[maxn];
bool cmp(node x, node y) { return x.len < y.len; }
int z[maxn];
void Z(char *s) {
  int len = strlen(s + 1);
  z[1] = len;
  for (int i = 2, l = 0, r = 0; i <= len; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l + 1]);
    while (i + z[i] <= len && s[i + z[i]] == s[z[i] + 1]) z[i]++;
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  for (int i = 1; i <= len; ++i) T[z[i]]++;
  for (int i = len; i >= 1; --i) T[i] += T[i + 1];
  for (int i = 1; i <= len; ++i)
    if (i + z[i] - 1 == len) ans[++cnt] = (node){z[i], T[z[i]]};
  printf("%d\n", cnt);
  sort(ans + 1, ans + 1 + cnt, cmp);
  for (int i = 1; i <= cnt; ++i) printf("%d %d\n", ans[i].len, ans[i].tim);
}
int main() {
  scanf("%s", str + 1);
  Z(str);
  return 0;
}
