#include <bits/stdc++.h>
using namespace std;
char s[100005];
int cnt[100005];
vector<int> prefix_function() {
  int n = strlen(s + 1);
  vector<int> match(n + 5);
  for (int i = 2; i <= n; i++) {
    int j = match[i - 1];
    while (j && s[i] != s[j + 1]) j = match[j];
    if (s[i] == s[j + 1]) j++;
    match[i] = j;
  }
  return match;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  vector<int> match = prefix_function();
  for (int i = 1; i <= n; i++) cnt[match[i]]++;
  for (int i = n; i >= 1; i--) cnt[match[i]] += cnt[i];
  vector<pair<int, int> > ans;
  int j = n;
  while (j) {
    ans.push_back({j, cnt[j] + 1});
    j = match[j];
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << "\n";
  for (pair<int, int> v : ans) cout << v.first << " " << v.second << "\n";
  return 0;
}
