#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
using v = vector<T>;
int main(int argc, char const* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  string str;
  ll S;
  cin >> str;
  S = str.size();
  v<ll> pi(S);
  for (ll i = 1; i < S; i++) {
    ll j = pi[i - 1];
    while (j != 0 && str[i] != str[j]) {
      j = pi[j - 1];
    }
    if (str[i] == str[j]) {
      j++;
    }
    pi[i] = j;
  }
  v<ll> count(S, 1);
  for (ll i = S - 1; i >= 0; i--) {
    if (pi[i] - 1 >= 0) {
      count[pi[i] - 1] += count[i];
    }
  }
  v<ll> matches;
  ll cur = S;
  while (cur >= 1) {
    matches.push_back(cur);
    cur = pi[cur - 1];
  }
  reverse(matches.begin(), matches.end());
  cout << matches.size() << "\n";
  for (const auto& match : matches) {
    cout << match << " " << count[match - 1] << "\n";
  }
  return 0;
}
