value=input().split()
n,m,k=int(value[0]),int(value[1]),int(value[2])
b=[]
for i in range(n):
    temp = []
    for j in range(n):
        temp.append(0)
    b.append(temp)
def zuobiao(x1,y1):
    if 0<=x1<=n-1 and 0<=y1<=n-1:
        return 1
    else:
        return 0
def huo(x,y):
    heng=x-2
    for i in range(heng,heng+5):
        temp= zuobiao(i,y)
        if temp:
            b[i][y] = 1

    lie=y-2
    for i in range(lie,lie+5):
        temp= zuobiao(x,i)
        if temp:
            b[x][i] = 1

    listx=[x-1,x+1]
    listy=[y-1,y+1]
    for i in listx:
        for j in listy:
            temp= zuobiao(i,j)
            if temp:
                b[i][j] = 1

def yingshi(x,y):
    heng=x-2
    lie=y-2
    for i in range(heng,heng+5):
        for j in range(lie,lie+5):
            temp= zuobiao(i,j)
            if temp:
                b[i][j] = 1
for i in range(m):
    x1,y1=map(int,input().split())
    huo(x1-1,y1-1)
for i in range(k):
    x2,y2=map(int,input().split())
    yingshi(x2-1,y2-1)
count=0
for i in range(n):
    for j in range(n):
        print(b[i][j],end=' ')
        if b[i][j]==0:
            count+=1
    print()
print(count)