#include <bits/stdc++.h>
using namespace std;
int fx[4] = {1, -1, 0, 0};
int fy[4] = {0, 0, 1, -1};
const double PI = acos(-1.0);
const double EPS = 1e-6;
const int MOD = (int)1e9 + 7;
const int maxn = (int)2e5 + 5;
int cnt[maxn];
vector<int> ans;
void z_algo(string s) {
  int n = (int)s.length();
  vector<int> z(n);
  int L, R;
  L = R = -1;
  ans.push_back(n);
  cnt[n] = 1;
  for (int i = 1; i < n; i++) {
    if (i <= R) {
      z[i] = min(z[i - L], R - i + 1);
    } else {
      z[i] = 0;
    }
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (z[i] == n - i) {
      ans.push_back(z[i]);
    }
    if (i + z[i] - 1 > R) {
      L = i, R = i + z[i] - 1;
    }
    cnt[z[i]] += 1;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  z_algo(s);
  int n = (int)s.length();
  for (int i = n - 1; i >= 1; i--) {
    cnt[i] += cnt[i + 1];
  }
  cout << ans.size() << endl;
  for (int i = (int)ans.size() - 1; i >= 0; i--) {
    cout << ans[i] << " " << cnt[ans[i]] << endl;
  }
  return 0;
}
