#include <bits/stdc++.h>
using namespace std;
long long power(long long b, long long e, long long m) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b % m, e / 2, m) % m;
  return power(b * b % m, e / 2, m);
}
long long power(long long b, long long e) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b, e / 2);
  return power(b * b, e / 2);
}
vector<long long> zFunction(string &s) {
  long long n = (long long)(s.size()), l, r, i;
  vector<long long> z(n);
  z[0] = n;
  l = r = 0;
  for (i = 1; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[z[i] + i]) ++z[i];
    if (i + z[i] - 1 > r) {
      l = i;
      r = i + z[i] - 1;
    }
  }
  return z;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  vector<long long> v = zFunction(s);
  map<long long, long long> m;
  long long n = s.length();
  set<int> ss;
  for (long long i = 0; i < v.size(); i++) {
    if ((v[i] + i) == n) {
      m[v[i]]++;
      m[v[i]]--;
      ss.insert(v[i]);
    }
  }
  m[n]++;
  for (long long i = 1; i < (n); i++) {
    auto it = ss.upper_bound(v[i]);
    if (it != ss.begin()) {
      it--;
      m[*it]++;
    }
  }
  auto it = m.rbegin();
  it++;
  for (auto i = it; i != m.rend(); i++) {
    auto it2 = i;
    it2--;
    m[i->first] += m[it2->first];
  }
  cout << m.size() << "\n";
  for (auto i : m) cout << i.first << " " << i.second << "\n";
  return 0;
}
