#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
string s;
int zrr[1000005];
int ct[1000005];
void compute_z() {
  int l = 0, r = 0;
  int sz = s.size();
  zrr[0] = sz;
  for (int i = 1; i < sz; i++) {
    if (r < i) {
      l = r = i;
      while (r < sz && s[r - l] == s[r]) r++;
      zrr[i] = r - l;
      r--;
    } else {
      int k = i - l;
      if (zrr[k] < r - i + 1)
        zrr[i] = zrr[k];
      else {
        l = i;
        while (r < sz && s[r - l] == s[r]) r++;
        zrr[i] = r - l;
        r--;
      }
    }
  }
}
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  compute_z();
  int sz = s.size();
  for (int i = 0; i < sz; i++) {
    ct[zrr[i]]++;
  }
  for (int i = 1; i <= sz; i++) {
    ct[i] += ct[i - 1];
  }
  int ans = 0;
  int st = 0;
  int x;
  for (int len = 1; len <= sz; len++) {
    x = sz - len;
    if (zrr[x] == len) ans++;
  }
  cout << ans << '\n';
  for (int len = 1; len <= sz; len++) {
    x = sz - len;
    if (zrr[x] != len) continue;
    cout << len << " " << ct[sz] - ct[len - 1] << '\n';
  }
  return 0;
}
