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 diversity(Slice):
    import string
    alphabet = list(string.ascii_lowercase)
    m = 0
    for fuc in alphabet:
        num = Slice.count(fuc)
        if num >= 1:
            m = m + 1
    return m
    
from itertools import combinations


def slicer(string):
    res = [string[z:d] for z, d in combinations(range(len(string) + 1), r=2)]
    return res

def useless(string):
    hell = []
    for i in slicer(string):
        hell.append(diversity(i))

    return hell
    
def final(string):
    l = useless(string)
    g = []
    v = max(l)
    print(v)
    for f in range(v + 1):
        g.append(f)
    g.pop(0)
    for h in g:
        print(l.count(h))
        
s = input()
final(s)