#include <bits/stdc++.h>
using namespace std;
char P[100002];
int cnt[100002], m;
int Z[2 * 100002];
vector<int> pt;
void buildZ(char *str) {
  int len = m;
  int l, r, k;
  Z[0] = -1;
  l = r = 0;
  for (int i = 1; i < len; i++) {
    if (i > r) {
      l = r = i;
      while (r < len && str[r - l] == str[r]) r++;
      Z[i] = r - l;
      r--;
    } else {
      k = i - l;
      if (Z[k] < r - i + 1)
        Z[i] = Z[k];
      else {
        l = i;
        while (r < len && str[r - l] == str[r]) r++;
        Z[i] = r - l;
        r--;
      }
    }
  }
  Z[0] = m;
  for (int i = 0; i < len; i++) {
    if ((i + Z[i]) == m) pt.push_back(Z[i]);
    cnt[Z[i]]++;
  }
}
int main() {
  gets(P);
  m = strlen(P);
  buildZ(P);
  for (int i = m - 1; i > 0; i--) cnt[i] = cnt[i + 1] + cnt[i];
  sort(pt.begin(), pt.end());
  printf("%d\n", pt.size());
  for (int i = 0; i < pt.size(); i++) {
    printf("%d %d\n", pt[i], cnt[pt[i]]);
  }
  return 0;
}
