#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int mod = 1000000007;
const int inf = 0x3f3f3f3f;
char str[N];
int Next[N];
void init() {
  int n = strlen(str);
  Next[0] = 0;
  int i = 1, len = 0;
  while (i < n) {
    if (str[len] == str[i])
      Next[i++] = ++len;
    else if (len == 0)
      Next[i++] = 0;
    else
      len = Next[len - 1];
  }
}
int ans[N], vis[N], tot;
int main() {
  scanf("%s", str);
  init();
  int n = strlen(str);
  for (int i = n; i; i--) {
    Next[i] = Next[i - 1];
    ans[i] = 1;
  }
  vis[n] = 1;
  for (int i = n; i; i--) {
    ans[Next[i]] += ans[i];
    if (vis[Next[i]] == 0) vis[Next[i]] = vis[i];
    if (vis[i]) tot++;
  }
  printf("%d\n", tot);
  for (int i = 1; i <= n; i++) {
    if (vis[i]) printf("%d %d\n", i, ans[i]);
  }
  return 0;
}
