#include <bits/stdc++.h>
using namespace std;
vector<long long> prefix_function(string s) {
  long long n = (long long)s.length();
  vector<long long> pi(n);
  for (long long i = 1; i < n; i++) {
    long long j = pi[i - 1];
    while (j > 0 && s[i] != s[j]) {
      j = pi[j - 1];
    }
    if (s[i] == s[j]) {
      j++;
    }
    pi[i] = j;
  }
  return pi;
}
int main() {
  string s;
  vector<long long> v;
  cin >> s;
  v = prefix_function(s);
  long long n = s.size();
  vector<long long> v1(n + 1, 0);
  for (long long i = 0; i < n; i++) {
    v1[v[i]]++;
  }
  for (long long i = n - 1; i > 0; i--) {
    v1[v[i - 1]] += v1[i];
  }
  for (long long i = 0; i <= n; i++) {
    v1[i]++;
  }
  vector<long long> h;
  vector<long long> h1;
  long long hash = 0;
  long long MOD = 1000000007;
  vector<long long> po(1000000, 1);
  for (long long i = 1; i < 1000000; i++) {
    po[i] = (po[i - 1] * 31) % MOD;
  }
  for (long long i = 0; i < n; i++) {
    hash += ((s[i] - 'A' + 1) * po[i]) % MOD;
    hash = hash % MOD;
    h.push_back(hash);
  }
  hash = 0;
  for (long long i = n - 1; i >= 0; i--) {
    hash *= 31;
    hash += (s[i] - 'A' + 1);
    hash = hash % MOD;
    h1.push_back(hash);
  }
  vector<long long> ans;
  for (long long i = 0; i < n; i++) {
    if (h1[i] == h[i]) {
      ans.push_back(i);
    }
  }
  cout << ans.size() << endl;
  long long n1 = ans.size();
  for (long long i = 0; i < n1; i++) {
    cout << ans[i] + 1 << " " << v1[ans[i] + 1] << endl;
  }
}
