#include <bits/stdc++.h>
using namespace std;
void solve(string s) {
  int n = s.size();
  s = '#' + s;
  vector<int> pi(n + 1);
  pi[0] = 0, pi[1] = 0;
  for (int i = 2; i <= n; i++) {
    int j = pi[i - 1];
    while (j > 0 && s[i] != s[j + 1]) j = pi[j];
    if (s[i] == s[j + 1]) j++;
    pi[i] = j;
  }
  int dp[n + 1];
  for (int i = 0; i <= n; i++) dp[i] = 1;
  for (int i = n; i >= 1; i--) dp[pi[i]] += dp[i];
  vector<pair<int, int> > res;
  res.push_back(pair<int, int>(n, 1));
  int j = pi[n];
  if (j == 0) {
    cout << 1 << endl;
    cout << n << " 1" << endl;
    return;
  }
  res.push_back(pair<int, int>(j, dp[j]));
  while (j > 0) {
    j = pi[j];
    if (j == 0) break;
    res.push_back(pair<int, int>(j, dp[j]));
  }
  cout << res.size() << endl;
  for (int i = res.size() - 1; i >= 0; i--)
    cout << res[i].first << " " << res[i].second << endl;
}
int main() {
  string s;
  cin >> s;
  solve(s);
}
