Hide

Problem B
Hakkari

Languages en is
/problems/hakkari/file/statement/en/img-0001.png
Bergur hacking

Bergur the hacker has just returned from Holland in his new fine Adidas suit and is ready to work. He opens his email and sees a message from hackers.com. The message asks for a program that hacks Minesweeper and finds all the mines in the game. The message also specifies that this program has to be ready tomorrow.

“No problem” Bergur thinks to himself and starts programming.

A few hours later Bergur finishes his program. His program prints $n$ rows and $m$ columns where each cell contains . if there is no mine there or * if there is a mine there. After all this work Bergur is completely exhausted. He decides to have a beer left over from his trip to Holland.

A while later Bergur is absolutely wasted and then his girlfriend, Björk, comes home. Björk and Bergur make a good team. Bergur hacks things and then Björk checks if he actually did what he was asked to. Since Bergur has passed out, Björk goes for his computer and checks the message from hackers.com. She carefully reads everything until she sees the last paragraph.

The program may not output a grid of information. The program has to return a pair of numbers for each mine. Each pair should contain the row and column that the mine was in.

Dammit, Bergur hadn’t read the entire email and Björk can’t make him fix it due to his state. Can you help Björk change Bergur’s program so it functions like hackers.com wants it to?

Input

The first line contains $1 \le n,m \le 100$. The next $n$ lines contain $m$ characters each, either * or . depending on whether there is a mine in that cell or not.

Output

On the first line you should print a single integer $k$, the number of mines. The next $k$ lines should each contain two integers $r_i, c_i$ which denote the row and column of the $i$-th mine. The mines can be printed in any order.

Scoring

Group

Points

Constraints

1

40

$1 \le n,m \le 15$

2

60

No further constraints

Sample Input 1 Sample Output 1
4 3
***
...
...
...
3
1 1
1 2
1 3
Sample Input 2 Sample Output 2
3 3
***
*.*
***
8
1 1
1 2
1 3
2 1
2 3
3 1
3 2
3 3

Please log in to submit a solution to this problem

Log in