#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
string second;
int n, z[int(5e5) + 10], cost[int(5e5) + 10];
void Z_Algorithm() {
  int L = 0, R = 0;
  z[0] = n;
  for (int i = 1; i < n; i++) {
    if (i > R) {
      L = R = i;
      while (R < n && second[R - L] == second[R]) {
        R++;
      }
      z[i] = R - L;
      R--;
    } else {
      int k = i - L;
      if (z[k] < R - i + 1) {
        z[i] = z[k];
      } else {
        L = i;
        while (R < n && second[R - L] == second[R]) {
          R++;
        }
        z[i] = R - L;
        R--;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cost[z[i]]++;
  }
  for (int i = n - 1; ~i; i--) {
    cost[i] += cost[i + 1];
  }
}
int main() {
  cin >> second;
  n = second.size();
  Z_Algorithm();
  for (int i = 0; i < n; i++) {
    if (i + z[i] == n) {
      ans.push_back(z[i]);
    }
  }
  reverse(ans.begin(), ans.end());
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < ans.size(); i++) {
    printf("%d %d\n", ans[i], cost[ans[i]]);
  }
}
