432. Partition this string

0

Medium

You are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one part. Note that the partition is done so that after concatenating all the parts in order, the resultant string should be s. Output the number of characters in each partition, separated by space.

Input Format

A string.

Output Format

Space-separated integers, representing the sizes of each partition.

Example

Input

ababcbacadefegdehijhklij

Output

9 7 8

Constraints

1 <= s.length() <= 500
s consists of lowercase English letters.
Loading...

View Submissions

Console