#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
const int maxm = 305;
long long arr[maxn];
long long arr1[maxn];
const long long mod = (long long)(998244353);
vector<long long> edges[maxn];
long long n, m, v, k, q, D, H, a, b, c, h, d, x, y, z, t;
string s, s1, s2;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long par[maxn];
void init() {
  for (int i = 0; i < maxn; i++) par[i] = i;
}
long long find(int i) {
  if (par[i] != i) {
    return par[i] = find(par[i]);
  } else
    return i;
}
void merge(int x, int y) { par[find(x)] = par[find(y)]; }
long long presum[100];
long long ans[100];
string input[maxn];
bool isVowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
    return true;
  else
    return false;
};
vector<int> get_pi(string s) {
  int n = s.length();
  vector<int> pi(n);
  int k = 0;
  for (int i = 1; i < n; i++) {
    while (k > 0 && s[i] != s[k]) k = pi[k - 1];
    if (s[i] == s[k]) k++;
    pi[i] = k;
  }
  return pi;
}
int cnt[maxn];
int main() {
  cin >> s;
  vector<int> pi = get_pi(s);
  int n = s.length();
  for (int i = 0; i < maxn; i++) cnt[i] = 1;
  for (int i = n - 1; i >= 0; i--) {
    cnt[pi[i] - 1] += cnt[i];
  }
  vector<pair<int, int> > v;
  int pos = n - 1;
  while (pos >= 0) {
    v.push_back({pos + 1, cnt[pos]});
    if (pos == 0) break;
    pos = pi[pos] - 1;
  }
  sort(v.begin(), v.end());
  cout << v.size() << endl;
  for (auto x : v) {
    cout << x.first << " " << x.second << endl;
  }
  return 0;
}
