#include <bits/stdc++.h>
const long long inf = 1e18;
using namespace std;
vector<long long> prefix_function(string s) {
  long long n = s.length();
  vector<long long> pi(n);
  for (long long i = 1; i < n; i++) {
    long long j = pi[i - 1];
    while (j > 0 && s[i] != s[j]) j = pi[j - 1];
    if (s[i] == s[j]) j++;
    pi[i] = j;
  }
  return pi;
}
vector<long long> adj[100009];
long long cnt[100009], parent[100009], curr;
void dfs(long long x, long long par) {
  cnt[x]++;
  parent[x] = par;
  for (auto it : adj[x]) {
    if (it != par) dfs(it, x), cnt[x] += cnt[it];
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  vector<long long> pi = prefix_function(s);
  for (long long i = 0; i < pi.size(); i++)
    adj[i + 1].push_back(pi[i]), adj[pi[i]].push_back(i + 1);
  dfs(0, 0);
  vector<pair<long long, long long> > ans;
  curr = s.length();
  while (curr) {
    ans.push_back({curr, cnt[curr]}), curr = parent[curr];
  }
  reverse(ans.begin(), ans.end());
  cout << ans.size() << "\n";
  for (auto it : ans) cout << it.first << " " << it.second << "\n";
  return 0;
}
