#include<cstdio> #include<cstring> #include<algorithm> usingnamespace std; typedeflonglong L; constint N = 1e5 + 10; char s[N]; int n, f[N], g[N]; voidinit() { for (int i = 1, t = 0; i < n; ++i) { if (t + f[t] > i) f[i] = min(f[i - t], t + f[t] - i); while (i + f[i] < n && s[f[i]] == s[i + f[i]]) ++f[i]; if (i + f[i] > t + f[t]) t = i; } f[0] = n; } intmain() { scanf("%s", s); n = strlen(s); init(); int res = 0; for (int i = 0; i < n; ++i) { ++g[f[i]]; if (f[i] == n - i) ++res; } for (int i = n - 1; i; --i) g[i] += g[i + 1]; printf("%d\n", res); for (int i = n - 1; ~i; --i) if (f[i] == n - i) printf("%d %d\n", f[i], g[f[i]]); return0; }