- Time limit: 1.00 s
- Memory limit: 512 MB
There is an grid whose each square is empty or has a coin. On each move, you can remove all coins in a row or column.
What is the minimum number of moves after which the grid is empty?
Input
The first input line has an integer : the size of the grid. The rows and columns are numbered .
After this, there are lines describing the grid. Each line has characters: each character is either .
(empty) or o
(coin).
Output
First print an integer : the minimum number of moves. After this, print lines describing the moves.
On each line, first print (row) or (column), and then the number of a row or column. You can print any valid solution.
Constraints
Example
Input:
3 ..o o.o ...
Output:
2 1 2 2 3