// Stop the noise and stop the clocks
// Problem: #P6067. 「FJOI2022」重复函数问题
// Contest: Hydro
// URL: http://10.110.182.1/p/P6067
// Time: 2024-01-20 10:06:09
// Memory Limit: 512 MB
// Author: Cocoly1990
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#pragma GCC optimize("Ofast","inline","-ffast-math")
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
int n, z[N], nxt[N], ans[N], fa[N];
char s[N];
set<int> st;
vector<int> vec[N];
struct Fenwick_Tree {
int t[N];
void add (int x, int k) {
if (! x) return;
for (; x <= n; x += x & -x) t[x] += k;
}
void add (int l, int r, int k) {
add (l, k);
add (r + 1, -k);
}
int ask (int x) {
int res = 0;
for (; x; x -= x & -x) res += t[x];
return res;
}
} t;
signed main () {
ios :: sync_with_stdio (false); cin.tie (0); cout.tie (0);
cin >> (s + 1);
n = strlen (s + 1);
nxt[1] = 0;
for (int i = 2, j = 0; i <= n; i ++) {
while (j and s[j + 1] != s[i]) j = nxt[j];
nxt[i] = (j += s[j + 1] == s[i]);
}
z[1] = n;
for (int i = 2, l = 0, r = 0; i <= n; i ++) {
if (i <= r) z[i] = min(z[i - l + 1], r - i + 1);
while (i + z[i] <= n and s[i + z[i]] == s[z[i] + 1]) z[i] ++;
if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
}
for (int i = 1; i <= n; i ++)
vec[z[i]].push_back (i);
t.add (1, n, n + 1);
st.insert (0);
st.insert (n + 1);
// return 0;
for (int k = nxt[n], lst = n + 1; k; k = nxt[k]) {
// cout << k << "?\n";
if (k * 2 > n) continue;
for (int i = k; i < lst; i ++) {
for (auto pos : vec[i]) {
st.insert (pos);
auto it = st.find (pos);
int val = t.ask (pos);
it = prev (it);
int lst = *it + 1;
t.add (lst, pos, -val);
t.add (lst, pos, pos);
}
}
// continue;
lst = k;
int x = 1, cnt = 0;
for (; x <= n; ) {
// if (k == 3) cout << x << "?\n";
auto pos = t.ask (x);
assert (pos >= x);
if (pos == n + 1) break;
cnt ++;
x = pos + k;
}
// cout << cnt << " " << k << "?\n";
ans[cnt] = max (ans[cnt], k);
}
for (int i = n; i; i --) ans[i] = max (ans[i], ans[i + 1]);
for (int i = 2; i <= n; i ++) cout << ans[i] << " ";
}