#include <bits/stdc++.h>
using namespace std;
vector<int> z_fun(string s) {
  int i, l, r, n;
  n = s.size();
  vector<int> z(n);
  for (i = 1, l = 0, r = 0; i < n; i++) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) {
      l = i;
      r = i + z[i] - 1;
    }
  }
  return z;
}
vector<int> Z, ans, temp;
map<int, int> m;
bool mark[100005];
int main() {
  int i, j, k, n, cnt = 0;
  string s;
  cin >> s;
  m.clear();
  n = s.size();
  Z = z_fun(s);
  temp = Z;
  for (i = 0; i < n; i++) {
    if (i + Z[i] == n && mark[Z[i]] == 0) {
      ans.push_back(Z[i]);
      mark[Z[i]] = 1;
    }
    m[Z[i]]++;
  }
  ans.push_back(n);
  sort(ans.begin(), ans.end());
  sort(temp.begin(), temp.end());
  printf("%d\n", ans.size());
  for (i = 0; i < ans.size(); i++) {
    k = upper_bound(temp.begin(), temp.end(), ans[i]) - temp.begin();
    k = n - k;
    cnt = m[ans[i]] + k + 1;
    printf("%d %d\n", ans[i], cnt);
  }
  return 0;
}
