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 substring_diversity(s):
    n = len(s)

    # Initialize variables to store diversity counts.
    diversity = 0
    diversity_count = [0] * (n + 1)

    # Create a dictionary to keep track of character occurrences.
    char_count = {}
    j = 0

    for i in range(n):
        # Increase the count of the current character.
        char_count[s[i]] = char_count.get(s[i], 0) + 1

        # While there are duplicate characters, move the left pointer.
        while char_count[s[i]] > 1:
            char_count[s[j]] -= 1
            j += 1

        # Update diversity.
        diversity = i - j + 1

        # Update diversity_count.
        diversity_count[diversity] += 1

    return diversity, diversity_count[1:]

# Read input
s = input().strip()

# Calculate diversity and diversity_count
diversity, diversity_count = substring_diversity(s)

# Print the diversity of the string.
print(diversity)

# Print the statistics about substrings diversity.
print(*diversity_count)
