#include <bits/stdc++.h>
using namespace std;
long long pi[1000005];
string str;
void lps(string& s) {
  long long n = s.size(), j;
  for (long long i = 1; i < n; i++) {
    j = pi[i - 1];
    while (j > 0 && s[i] != s[j]) j = pi[j - 1];
    if (s[i] == s[j]) j++;
    pi[i] = j;
  }
}
int main() {
  string str;
  cin >> str;
  long long n = str.size();
  map<int, int> ans;
  lps(str);
  long long i, j, k;
  for (i = 0; i < n; i++) ans[pi[i]]++;
  for (i = n - 1; i > 0; i--) ans[pi[i - 1]] += ans[i];
  for (i = 0; i <= n; i++) ans[i]++;
  long long temp = pi[n - 1];
  vector<long long> v;
  while (temp > 0) {
    v.push_back(temp);
    temp = pi[temp - 1];
  }
  v.push_back(n);
  vector<pair<long long, long long>> mp;
  for (auto x : v) {
    mp.push_back({ans[x], x});
  }
  sort(mp.begin(), mp.end());
  reverse(mp.begin(), mp.end());
  cout << mp.size() << '\n';
  for (auto x : mp) cout << x.second << " " << x.first << '\n';
}
