#include <bits/stdc++.h>
using namespace std;
const long long mxn = 1e5 + 1;
const long long mod = 998244353;
const long long inf = 1e18;
const long double eps = 1e-9;
const long double PI = acos(-1);
inline void joji(bool ok = 0) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  if (ok) {
    freopen(
        "rvq"
        ".in",
        "r", stdin);
    freopen(
        "rvq"
        ".out",
        "w", stdout);
  }
}
int64_t p[mxn], sum[mxn];
int64_t cnt[mxn];
signed main() {
  joji();
  string s;
  cin >> s;
  p[0] = 0;
  for (int64_t i = 1; i < (int64_t)s.size(); i++) {
    int64_t j = p[i - 1];
    while (j > 0 && s[i] != s[j]) j = p[j - 1];
    p[i] = j + (s[i] == s[j]);
    cnt[p[i]]++;
  }
  for (int64_t i = (int64_t)s.size() - 1; i > 0; i--) cnt[p[i - 1]] += cnt[i];
  set<int64_t> q;
  int64_t x = (int64_t)s.size();
  while (x) {
    if (x) q.insert(x);
    x = p[x - 1];
  }
  cout << (int64_t)q.size() << "\n";
  for (auto it : q) cout << it << ' ' << cnt[it] + 1 << "\n";
  return 0;
}
