def shortest_string_for_connected_components(S):
    N = len(S)
    
    # dp[k] will hold the minimum length of a string that results in exactly k connected components
    dp = [float('inf')] * (N + 1)
    dp[0] = 0  # 0 components require 0 length
    
    # To track the positions of each character
    from collections import defaultdict
    
    # For each starting point
    for l in range(N):
        seen = set()  # To track characters in the current substring
        for r in range(l, N):
            seen.add(S[r])
            # The number of unique characters in the substring S[l:r+1]
            unique_count = len(seen)
            dp[unique_count] = min(dp[unique_count], r - l + 1)
    
    # Prepare the result
    result = []
    for k in range(1, N + 1):
        result.append(dp[k] if dp[k] != float('inf') else 0)
    
    return result

# Read input
S = input().strip()
result = shortest_string_for_connected_components(S)
print(' '.join(map(str, result)))