Now that spring is here and the sun is shining bright, people are starting to lower their blinds. Štefica is an elderly woman who likes to keep track of what other people in the neighbourhood are doing and then talk about it behind their backs. This year, she is particularly interested in who is lowering blinds in the building across the street, and how low are they lowering them.
We will represent each window with a grid, with asterisks representing lowered blinds. Štefica can see a window in one of the following states:
.... **** **** **** ****
.... .... **** **** ****
.... .... .... **** ****
.... .... .... .... ****
The building across the street has windows at each of the floors. Given the current building state, find out how many windows are in each of the states shown above.
Input Specification
The first line of input contains space separated integers and .
The following lines describe the current building state. Each window is represented with one of the grids shown above, and windows are separated using the character #
. See the example input for clarification. Building description will have exactly lines each having characters.
Output Specification
Output should contain space separated integers, the number of windows for each type in the order shown above. The sum of these numbers is .
Sample Input 1
1 2
###########
#....#****#
#....#****#
#....#....#
#....#....#
###########
Sample Output 1
1 0 1 0 0
Sample Input 2
2 3
################
#****#****#****#
#****#****#****#
#****#....#****#
#....#....#****#
################
#....#****#****#
#....#****#....#
#....#....#....#
#....#....#....#
################
Sample Output 2
1 1 2 1 1
Comments