#include <bits/stdc++.h>
using namespace std;
const int sz = 1e5 + 5;
char s[sz];
int zara[sz], cnt[sz];
vector<int> ans;
void zfnc(string s) {
  for (int i = 1, l = 0, r = 0, n = s.size(); i < n; i++) {
    int now = i > r ? 0 : min(zara[i - l], r - i + 1);
    while (i + now < n && s[now] == s[i + now]) now++;
    if (i + now - 1 > r) r = i + now - 1, l = i;
    zara[i] = now;
    cnt[now]++;
    if (i + now == n) ans.push_back(now);
  }
  ans.push_back(s.size());
  sort(ans.begin(), ans.end());
}
int main() {
  scanf("%s", s);
  zfnc(s);
  for (int i = strlen(s); i; i--) cnt[i - 1] += cnt[i];
  printf("%d\n", ans.size());
  for (int x : ans) printf("%d %d\n", x, cnt[x] + 1);
}
