#include <bits/stdc++.h>
using namespace std;
int LPS[100005];
int ans[100005];
void LPS_evaluate(string pattern) {
  LPS[0] = 0;
  int match = 0, now = 1;
  while (now < pattern.size()) {
    if (pattern[now] == pattern[match])
      LPS[now++] = ++match;
    else {
      if (match)
        match = LPS[match - 1];
      else
        LPS[now++] = 0;
    }
  }
  int n = pattern.size();
  for (int i = 0; i < pattern.size(); i++) ans[LPS[i]]++;
  for (int i = pattern.size() - 1; i > 0; i--) ans[LPS[i - 1]] += ans[i];
  for (int i = 0; i <= pattern.size(); i++) ans[i]++;
}
string s;
int main() {
  vector<pair<int, int> > v;
  cin >> s;
  LPS_evaluate(s);
  int g = s.size();
  while (g != 0) {
    v.push_back(make_pair(g, ans[g]));
    g = LPS[g - 1];
  }
  reverse(v.begin(), v.end());
  cout << v.size() << endl;
  for (auto i : v) cout << i.first << " " << i.second << endl;
  return 0;
}
