import itertools
import numpy as np

from collections import Counter

S = list(input())

def split(a):
    if not a:
        return [[]]
    elif len(a) == 1:
        return [[a]]
    else:
        return [(a[:i], *sub_split) for i in range(1, len(a) + 1) for sub_split in split(a[i:])]


if __name__ == '__main__':
    A = list(range(len(S)))
    B = split(A)
    for i in range(len(S)-1, 0, -1):
        N = [x for x in B if len(x) == i]
        print(len(N))
        # print(N[0])


    print(N)
