- Time limit: 1.00 s
- Memory limit: 256 MB
You are given a string of bits. Your task is to calculate for each the number of non-empty substrings that contain exactly ones.
For example, if the string is 101, there are:
- 1 substring that contains 0 ones: 0
- 4 substrings that contain 1 ones: 01, 1, 1, 10
- 1 substring that contains 2 ones: 101
- 0 substrings that contain 3 ones
Input
The first input line contains an integer : the number of test cases.
After this, lines follow. Each line contains a string of length .
Output
For each test case, output values as specified above.
Constraints
- the sum of all values is at most
Example
Input:
3 101 1111 01
Output:
1 4 1 0 0 4 3 2 1 1 2 0