#include <bits/stdc++.h>
using namespace std;
const int maxn = 111111;
int p[maxn], dp[maxn];
void print(int pos, int step) {
  if (pos == 0) {
    printf("%d\n", step + 1);
    return;
  }
  print(p[pos], step + 1);
  printf("%d %d\n", pos, dp[pos]);
}
void get_p(char *s, int len) {
  p[1] = 0;
  dp[1] = 1;
  for (int i = 2, j = 0; i <= len; i++) {
    while (j && s[i] != s[j + 1]) j = p[j];
    if (s[i] == s[j + 1]) j++;
    p[i] = j;
    dp[i] = 1;
  }
  for (int i = len; i >= 1; i--) dp[p[i]] += dp[i];
  print(p[len], 0);
  printf("%d %d\n", len, 1);
}
char s[maxn];
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  get_p(s, len);
  return 0;
}
