String diversity is the number of symbols that occur in the string at least once. Diversity of *s* will be denoted by *d*(*s*). For example , *d*("aaa")=1, *d*("abacaba")=3.

Given a string *s*, consisting of lowercase Latin letters. Consider all its substrings. Obviously, any substring diversity is a number from 1 to *d*(*s*). Find statistics about substrings diversity: for each *k* from 1 to *d*(*s*), find how many substrings of *s* has a diversity of exactly *k*.
The input consists of a single line containing *s*. It contains only lowercase Latin letters, the length of *s* is from 1 to 3·10<sup class="upper-index">5</sup>.
def lulu(s):
    d=cnt(s)
    ans=[0]*(d+1)
    #print(ans)
    for i in range(len(s)):
        scur=s[i]
        ans[1]+=1
        for j in range(i+1,len(s)):
            scur+=s[j]
            k=cnt(scur)
            ans[k]+=1
    fn=str(d)
    fn+='\n'
    for i in range(1,len(ans)):
        fn+=str(ans[i])
        if i!=len(ans)-1: fn+='\n'
    return fn


def cnt(s1):
    s=sorted(s1)
    cnt=1
    for i in range(1,len(s)):
        if s[i]!=s[i-1]:
            cnt+=1
    return cnt

s=input()
print(lulu(s))
