UVa 10279 - Mine Sweeper

Summary
Simulate the state of a mine sweeper game given the revealed positions of the map.

Explanation

 * Look at the explanation for this problem UVa_10189.
 * We need to keep track of whether a mine is revealed or not so we can decide to display them all later.
 * We also need to keep track of which cells we used.

Gotchas

 * Dont forget the blank line after each output.

Input
2

8 ...**..* ......*. ....*... ........ ........ .....*.. ...**.*. .....*.. xxx..... xxxx.... xxxx.... xxxxx... xxxxx... xxxxx... xxx..... xxxxx... 4 ...* ..*. .... .... xxx. xxxx xxxx x...

Output
001..... 0013.... 0001.... 00011... 00001... 00123... 001..... 00123...

012* 01*2 0111 0...