#include <bits/stdc++.h>
using namespace std;
const int nmax = 100010;
int n, pi[nmax], sum[nmax];
char s[nmax];
vector<pair<int, int> > ans;
int main() {
  gets(s + 1);
  n = strlen(s + 1);
  int q = 0;
  for (int i = 2; i <= n; ++i) {
    while (q && s[q + 1] != s[i]) q = pi[q];
    if (s[q + 1] == s[i]) q++;
    pi[i] = q;
  }
  for (int i = n; i; --i) {
    sum[i]++;
    sum[pi[i]] += sum[i];
  }
  for (int i = n; pi[i]; i = pi[i]) ans.push_back({pi[i], sum[pi[i]]});
  ans.push_back({n, 1});
  sort(ans.begin(), ans.end());
  printf("%i\n", ans.size());
  for (int i = 0; i < ans.size(); ++i)
    printf("%i %i\n", ans[i].first, ans[i].second);
}
