Crossword
You drew a grid for a crossword puzzle, and now need to fill in his words. To do this you need to know how many words in the crossword puzzles of a certain length. Write a program that performs these calculations.
Input
In the input file a few tests. In the first line of each test contains two integers N and M through space - the size of the grid crossword (3 ≤ N ≤ 50, 3 ≤ M ≤ 50). This is followed by N lines, each containing M symbols '.' (empty cell) and 'X' (black, unused cell). A string containing "0 0", signals the completion of the test suite and is not processed.
Output
In the output file for each test to bring a string containing information about the number of words of each length in the form of L−K through a gap in the ascending order of L, where L – length of words (L ≥ 2), K – number of words of such length (K > 0).