#include <iostream>
#include <cstring>
#define MAXN 100001
using namespace std;
int result[MAXN], cnt;
char s[MAXN];
int main()
{
while(gets(s))
{
cnt = 0;
memset(result , 0 , sizeof(result));
int l = 0, r = 0;
int k, len = strlen(s), si, zk;
printf("%d\n",len);
for(k = l; k < len; k ++)
{
cnt ++;
if( k > r )
{
zk = 0;
for(si = 0; si < len; si ++)
{
cnt ++;
if( k + si < len && s[si] == s[k + si]) continue;
else break;
}
if( si > 0 )
{
zk = si;
r = zk + k - 1;
l = k;
}
}
else
{
int kold = k - 1, zold = result[kold];
int b = r - k + 1;
if(zold < b) zk = zold;
else
{
zk = b;
for(si = b - 1; si < len; si ++)
{
cnt ++;
if(k + si < len && s[si] == s[k + si]) continue;
else break;
}
zk = si;
r = zk + k - 1;
l = k;
}
}
result[k] = zk;
}
printf("%d\n",cnt);
for(int i = 1; i < len; i ++) printf("%d %d \n",i,result[i]);
}
}