#include <stdio.h>

#include <string.h>

#define N 5000

int main() {

static char cc[N];

static int dp[N][N], kk[N + 1];

int n, i, j;

scanf(“%s”, cc);

n = strlen(cc);

for (i = 0; i < n; i++) {

dp[i][i] = 1;

if (i + 1 < n && cc[i] == cc[i + 1])

dp[i][i + 1] = 2;

}

for (i = n – 1; i >= 0; i–)

for (j = i + 2; j < n; j++)

if (dp[i + 1][j – 1] > 0 && cc[i] == cc[j])

dp[i][j] = dp[i][(i + j – 1) / 2] + 1;

for (i = 0; i < n; i++)

for (j = i; j < n; j++)

kk[dp[i][j]]++;

for (i = n – 1; i >= 1; i–)

kk[i] += kk[i + 1];

for (i = 1; i <= n; i++)

printf(“%d “, kk[i]);

printf(“\n”);

return 0;

}