def solve(S):
    N = len(S)
    # Initialize dp array with infinity
    dp = [float('inf')] * (N + 1)
    dp[0] = 0  # 0 components requires 0 length string

    # Dictionary to store the lengths of shortest strings for each number of components
    for length in range(1, N + 1):
        for start in range(N - length + 1):
            substring = S[start:start + length]
            last_index = start
            components = 1  # Start with one component
            
            # Create bridges based on the substring
            for j in range(1, length):
                current_index = start + j
                # If the current character matches the previous one in the substring
                if S[last_index] == S[current_index]:
                    continue
                else:
                    components += 1
                
                last_index = current_index
            
            # Update the dp array
            dp[components] = min(dp[components], length)

    # Prepare the result array
    result = []
    for k in range(1, N + 1):
        result.append(dp[k] if dp[k] != float('inf') else 0)
    
    return result

def main():
    import sys
    input = sys.stdin.read
    S = input().strip()
    
    result = solve(S)
    print(" ".join(map(str, result)))

if __name__ == "__main__":
    main()