#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int s[MAXN];
int wa[MAXN], wb[MAXN], wv[MAXN], Ws[MAXN];
int cmp(int *r, int a, int b, int l) {
  return r[a] == r[b] && r[a + l] == r[b + l];
}
int sa[MAXN], rk[MAXN], height[MAXN];
void SA(int *r, int n, int m) {
  int *x = wa, *y = wb;
  for (int i = 0; i < m; ++i) Ws[i] = 0;
  for (int i = 0; i < n; ++i) ++Ws[x[i] = r[i]];
  for (int i = 1; i < m; ++i) Ws[i] += Ws[i - 1];
  for (int i = n - 1; i >= 0; --i) sa[--Ws[x[i]]] = i;
  int p = 1;
  for (int j = 1; p < n; j <<= 1, m = p) {
    p = 0;
    for (int i = n - j; i < n; ++i) y[p++] = i;
    for (int i = 0; i < n; ++i)
      if (sa[i] >= j) y[p++] = sa[i] - j;
    for (int i = 0; i < n; ++i) wv[i] = x[y[i]];
    for (int i = 0; i < m; ++i) Ws[i] = 0;
    for (int i = 0; i < n; ++i) ++Ws[wv[i]];
    for (int i = 1; i < m; ++i) Ws[i] += Ws[i - 1];
    for (int i = n - 1; i >= 0; --i) sa[--Ws[wv[i]]] = y[i];
    swap(x, y);
    x[sa[0]] = 0;
    p = 1;
    for (int i = 1; i < n; ++i)
      x[sa[i]] = cmp(y, sa[i - 1], sa[i], j) ? p - 1 : p++;
  }
  for (int i = 1; i < n; ++i) rk[sa[i]] = i;
  int k = 0;
  for (int i = 0; i < n - 1; height[rk[i++]] = k) {
    if (k) --k;
    for (int j = sa[rk[i] - 1]; r[i + k] == r[j + k]; ++k)
      ;
  }
}
int vis[MAXN], num[MAXN], n;
int main() {
  string t;
  cin >> t;
  n = t.size();
  for (int i = 0; i < n; i++) {
    s[i] = t[i] - 'A' + 1;
  }
  SA(s, n + 1, 27);
  int pos = rk[0];
  int Min = 0x3f3f3f3f;
  int cnt = 0;
  for (int i = pos + 1; i < n; i++) {
    Min = min(Min, height[i]);
    if (Min != 0) {
      num[Min - 1]++;
    }
    if (Min == n - sa[i] && Min != 0) {
      vis[n - sa[i] - 1] = 1;
      cnt++;
    }
  }
  Min = 0x3f3f3f3f;
  for (int i = pos; i >= 1; i--) {
    Min = min(Min, height[i]);
    if (Min != 0) {
      num[Min - 1]++;
    }
    if (Min == n - sa[i - 1] && Min != 0) {
      vis[n - sa[i - 1] - 1] = 1;
      cnt++;
    }
  }
  if (!vis[n - 1]) vis[n - 1] = 1, cnt++, num[n - 1]++;
  for (int i = n - 1; i >= 0; i--) {
    num[i] += num[i + 1];
  }
  cout << cnt << endl;
  for (int i = 0; i < n; i++) {
    if (vis[i]) {
      printf("%d %d\n", i + 1, num[i]);
    }
  }
  return 0;
}
