Mole
After a difficult research, Anton decided to relax at his country house. He has a beautiful garden with many different flowers. But, oh no, upon arrival he saw a significant number of holes in the ground. It's a mole!
Now, armed with a shovel, Anton will be waiting for the mole. The mole can emerge from any hole. Anton wants to choose a position so that in the worst case, he runs to the mole in the minimum amount of time.
The garden can be represented as a matrix , where is the number of rows, and is the number of columns. Rows are numbered from top to bottom, from to . Columns are numbered from left to right, from to . Thus, the cell with index is located in the upper left corner.
Each cell of the garden describes the state of this cell:
= "
.
" — this cell does not contain flowers or holes;= "
F
" — this cell contains flowers;= "
H
" — this cell contains a hole.
Anton also knows that the number of holes does not exceed .
As a person who has put a lot of time into these flowers, your heart cannot bear trampling on them. Therefore, you need to find a path in such a way that it does not pass through them.
At any moment in time, Anton can move from position to any of the following positions: , , , , provided that the new position does not contain flowers and is inside the garden.
Find all positions () from which Anton will run to the moles in the worst case in the minimum amount of time.
Input
The first line contains two integers , () — the length and width of the garden.
The next lines contain characters each — the description of the garden.
It is guaranteed that from each cell that does not contain flowers, it is possible to reach any other cell that does not contain flowers by moving through cells that do not contain flowers.
It is guaranteed that there is at least one hole, and the number of holes in the garden does not exceed .
Output
In the first line, print a single integer () — the number of optimal positions.
In each of the next lines, print the optimal positions () for waiting for the mole (, ).
Positions can be printed in any order.
Examples
Note
Above is the first example and the optimal waiting positions are marked.
Scoring
Let be the number of holes in the garden.
( points): ;
( points): ;
( points): ;
( points): ;
( points): ;
( points): without additional restrictions.