# Arup Guha
# 1/25/2025
# Solution to Kattis Problem: Minesweeper
# https://open.kattis.com/problems/minesweeper

# Get basic input.
toks = input().split()
r = int(toks[0])
c = int(toks[1])
numB = int(toks[2])

# Make a grid of all 0s will store 1s for dots.
grid = []
for i in range(r):
    grid.append([])
    for j in range(c):
        grid[i].append(0)

# Read bomb locations, update board.
for i in range(numB):

    # Read in location of bomb
    loc = [int(x) for x in input().split()]

    # Need to subtract 1 from each value when indexing grid.
    grid[loc[0]-1][loc[1]-1] = 1

# Print it. Annoying I can't assign a character...
for i in range(r):
    for j in range(c):
        if grid[i][j] == 0:
            print('.', end="")
        else:
            print('*', end="")
    print()


