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>.
__author__ = 'asmn'

s = input()
n = len(s)
p = [s.find(chr(ord('a') + i)) for i in range(26)]
ans = [0] * 26

for i in range(n):
    tmp = sorted(filter(lambda x: x >= 0, p)) + [n]
    for k in range(1, len(tmp)):
        ans[k] += tmp[k] - tmp[k - 1]
    p[ord(s[i]) - ord('a')] = s.find(s[i], p[ord(s[i]) - ord('a')] + 1)

ans = list(filter(lambda c: c > 0, ans))

print(len(ans))
print(*tuple(ans), sep='\n')