#abc274b. [abc274_b]Line Sensor
[abc274_b]Line Sensor
Problem Statement
There is a grid with rows from top to bottom and columns from left to right. Let denote the square at the -th row from the top and -th column from the left.
The squares are described by characters . If is .
, is empty; if it is #
, contains a box.
For integers satisfying , let the integer defined as follows.
- is the number of boxes in the -th column. In other words, is the number of integers such that is
#
.
Find all of .
Constraints
- and are integers.
- is
.
or#
.
Input
The input is given from Standard Input in the following format:
Output
Print in the following format:
Sample Input 1
3 4
#..#
.#.#
.#.#
Sample Output 1
1 2 0 3
In the -st column, one square, , contains a box. Thus, .
In the -nd column, two squares, and , contain a box. Thus, .
In the -rd column, no squares contain a box. Thus, .
In the -th column, three squares, , , and , contain a box. Thus, .
Therefore, the answer is .
Sample Input 2
3 7
.......
.......
.......
Sample Output 2
0 0 0 0 0 0 0
There may be no square that contains a box.
Sample Input 3
8 3
.#.
###
.#.
.#.
.##
..#
##.
.##
Sample Output 3
2 7 4
Sample Input 4
5 47
.#..#..#####..#...#..#####..#...#...###...#####
.#.#...#.......#.#...#......##..#..#...#..#....
.##....#####....#....#####..#.#.#..#......#####
.#.#...#........#....#......#..##..#...#..#....
.#..#..#####....#....#####..#...#...###...#####
Sample Output 4
0 5 1 2 2 0 0 5 3 3 3 3 0 0 1 1 3 1 1 0 0 5 3 3 3 3 0 0 5 1 1 1 5 0 0 3 2 2 2 2 0 0 5 3 3 3 3