Minelayer#2671

Minelayer

1 second
64 megabytes
Easy

Given a list of mines, you need to create a Minesweeper game board.

Input

The numbers and (both integers, positive, not exceeding ) represent the number of rows and columns on the board, respectively. Next, the number (an integer, non-negative, not greater than ) represents the number of mines on the board. Following this, there are pairs of numbers, which are the coordinates of the mines on the board (the first number is the row, the second number is the column).

Output

You need to display the board on the screen, using the following format: if a given cell is a mine, display an asterisk *, otherwise display the number of mines in the neighboring cells (vertically, horizontally, and diagonally).

Examples

Example 1

Loading
Loading