#include <cstdio>
#include <iostream>
using namespace std;
const int maxn=100060;
const int sigma=26;
int n=0;
char s[maxn];
struct palindrome_tree
{
struct state
{
int len,link;
int to[sigma];
state():len(-1),link(-1){}
} st[maxn];
int last,sz;
palindrome_tree():last(1),sz(2){st[1].len=st[1].link=0;}
int add_letter()
{
char c=s[n-1];
int p=last;
while(p!=-1 && c!=s[n-st[p].len-2]) p=st[p].link;
if(p==-1)
{
last=1;
return 0;
}
int ret=0;
if(!st[p].to[c])
{
ret=1;
int q=last=sz++;
st[p].to[c]=q;
st[q].len=st[p].len+2;
do p=st[p].link; while(p!=-1 && c!=s[n-st[p].len-2]);
if(p==-1) st[q].link=1;
else st[q].link=st[p].to[c];
}
else last=st[p].to[c];
return ret;
}
};
int main()
{
palindrome_tree me;
ios::sync_with_stdio(0);
s[n++]='#';
int cur=0;
while((s[n++]=getchar())!='\n')
{
s[n-1]-='a';
cout<<(cur+=me.add_letter())<<' ';
}
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNvbnN0IGludCBtYXhuPTEwMDA2MDsKY29uc3QgaW50IHNpZ21hPTI2OwppbnQgbj0wOwpjaGFyIHNbbWF4bl07CgpzdHJ1Y3QgcGFsaW5kcm9tZV90cmVlCnsKICAgIHN0cnVjdCBzdGF0ZQogICAgewogICAgICAgIGludCBsZW4sbGluazsKICAgICAgICBpbnQgdG9bc2lnbWFdOwogICAgICAgIHN0YXRlKCk6bGVuKC0xKSxsaW5rKC0xKXt9CiAgICB9IHN0W21heG5dOwogICAgaW50IGxhc3Qsc3o7CiAgICBwYWxpbmRyb21lX3RyZWUoKTpsYXN0KDEpLHN6KDIpe3N0WzFdLmxlbj1zdFsxXS5saW5rPTA7fQoKICAgIGludCBhZGRfbGV0dGVyKCkKICAgIHsKICAgICAgICBjaGFyIGM9c1tuLTFdOwogICAgICAgIGludCBwPWxhc3Q7CiAgICAgICAgd2hpbGUocCE9LTEgJiYgYyE9c1tuLXN0W3BdLmxlbi0yXSkgcD1zdFtwXS5saW5rOwogICAgICAgIGlmKHA9PS0xKQogICAgICAgIHsKICAgICAgICAgICAgbGFzdD0xOwogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9CiAgICAgICAgaW50IHJldD0wOwogICAgICAgIGlmKCFzdFtwXS50b1tjXSkKICAgICAgICB7CiAgICAgICAgICAgIHJldD0xOwogICAgICAgICAgICBpbnQgcT1sYXN0PXN6Kys7CiAgICAgICAgICAgIHN0W3BdLnRvW2NdPXE7CiAgICAgICAgICAgIHN0W3FdLmxlbj1zdFtwXS5sZW4rMjsKICAgICAgICAgICAgZG8gcD1zdFtwXS5saW5rOyB3aGlsZShwIT0tMSAmJiBjIT1zW24tc3RbcF0ubGVuLTJdKTsKICAgICAgICAgICAgaWYocD09LTEpIHN0W3FdLmxpbms9MTsKICAgICAgICAgICAgZWxzZSBzdFtxXS5saW5rPXN0W3BdLnRvW2NdOwogICAgICAgIH0KICAgICAgICBlbHNlIGxhc3Q9c3RbcF0udG9bY107CiAgICAgICAgcmV0dXJuIHJldDsKICAgIH0KfTsKCgppbnQgbWFpbigpCnsKcGFsaW5kcm9tZV90cmVlIG1lOwppb3M6OnN5bmNfd2l0aF9zdGRpbygwKTsKICAgIHNbbisrXT0nIyc7CiAgICBpbnQgY3VyPTA7CiAgICB3aGlsZSgoc1tuKytdPWdldGNoYXIoKSkhPSdcbicpCiAgICB7CiAgICAgICAgc1tuLTFdLT0nYSc7CiAgICAgICAgY291dDw8KGN1cis9bWUuYWRkX2xldHRlcigpKTw8JyAnOwogICAgfQp9Cg==