#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, cnt[100010];
  string s;
  cin >> s;
  n = (int)s.length();
  int pi[100010];
  pi[0] = 0;
  for (i = 1; i < n; i++) {
    j = pi[i - 1];
    while (j > 0 and s[i] != s[j]) j = pi[j - 1];
    if (s[i] == s[j]) j++;
    pi[i] = j;
  }
  for (i = 0; i < n; i++) cnt[pi[i]]++;
  for (i = n - 1; i > 0; i--) cnt[pi[i - 1]] += cnt[i];
  for (i = 0; i < n; i++) cnt[i]++;
  vector<pair<int, int> > ans;
  i = n;
  cnt[n] = 1;
  while (i > 0) {
    ans.push_back({i, cnt[i]});
    i = pi[i - 1];
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (auto p : ans) cout << p.first << " " << p.second << endl;
}
