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>.
import string

def diversity(slice, alphabet_set):
    m = 0
    for char in slice:
        if char in alphabet_set:
            m += 1
    return m

def calculate_diversities(input_str):
    alphabet_set = set(string.ascii_lowercase)
    max_diversity = 0
    diversity_counts = [0] * (len(input_str) + 1)

    for start in range(len(input_str)):
        alphabet_count = [0] * 26  # 26 letters in the alphabet
        diversity = 0

        for end in range(start, len(input_str)):
            char = input_str[end]
            if char in alphabet_set:
                alphabet_count[ord(char) - ord('a')] += 1

                if alphabet_count[ord(char) - ord('a')] == 1:
                    diversity += 1

            if diversity > max_diversity:
                max_diversity = diversity

            diversity_counts[diversity] += 1

    return max_diversity, diversity_counts

def main():
    input_str = input()
    max_diversity, diversity_counts = calculate_diversities(input_str)

    print(max_diversity)

    for i in range(1, max_diversity + 1):
        count = diversity_counts[i]
        print(count)

if __name__ == "__main__":
    main()