Hide

Problem Q
Minesweeper

Languages en is
/problems/minesweeper/file/statement/en/img-0001.jpg
Minesweeper

Arnar is extremely skilled at Minesweeper, he’s been playing the game since 1989. His friend Bjarki keeps telling him that this isn’t impressive at all.

Bjarki: “Anyone can be good at Minesweeper.”
Arnar: “If it’s so easy, prove it, train up and then compete against me.”

Bjarki took this to heart and immediately started traning at Minesweeper.

After many weeks of training Bjarki hadn’t gotten any better at Minesweeper. He simply doesn’t have the logical thinking required for such a complex game. So he instead goes on hackers.com and downloads a hack for Minesweeper. The hack works by taking the game as an input and it prints out $k$ pairs of numbers. Each pair $y_i, x_i$ denotes the row and column where a mine is located.

Bjarki can’t be bothered to figure out where these locations are in Minesweeper. This is just a further headache. Can you help Bjarki and draw the Minesweeper board? Cells without a mine are denoted by . (a dot). Cells with a mine are denoted by * (an asterisk).

Input

The first line contains three integers $1 \le n,m \le 250$, $1 \le k \le n \cdot m$, where $n$ denotes the number of rows and $m$ denotes the number of colums in the Minesweeper board and $k$ gives the number of pairs the hack printed. The next $k$ lines contain two integers $1 \le y_i \le n$, $1 \le x_i \le m$ each.

Output

Print the board in its entirety. The output should contain $n$ lines and each line should contain $m$ characters.

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
***
*.*
***