Buggy python submission (verdict: Time Limit Exceeded):
H,W,N = map(int,input().split())
B=[[0 for k in range(W-2)] for j in range(H-2)]
li=[-1,0,1]
Nli=[]
for k in range(N):
    a,b=map(int,input().split())
    for n in range(3):
        for m in range(3):
            if 0<=a-2-li[m]<H-2 and 0<=b-2-li[n]<W-2:
                Nli.append((b-2-li[n])*(H-2)+(a-2-li[m]))
import collections
s = collections.Counter(Nli)
v = list(s.values())
print((H-2)*(W-2)-len(set(Nli)))
for k in range(1,10):
    print(v.count(k))

Fixed submission:
H,W,N = map(int,input().split())
Nli=[]
for k in range(N):
    a,b=map(int,input().split())
    for n in range(-1,2):
        for m in range(-1,2):
            if 0<=a-2-m<H-2 and 0<=b-2-n<W-2:
                Nli.append((b-n)*(H)+(a-m))
import collections
s = collections.Counter(Nli)
v = list(s.values())
print((H-2)*(W-2)-len(set(Nli)))
for k in range(1,10):
    print(v.count(k))

Buggy python submission (verdict: Time Limit Exceeded):
H,W,N = map(int,input().split())
B=[[0 for k in range(W-2)] for j in range(H-2)]
li=[-1,0,1]
Nli=[]
for k in range(N):
    a,b=map(int,input().split())
    for n in range(3):
        for m in range(3):
            if 0<=a-2-li[m]<H-2 and 0<=b-2-li[n]<W-2:
                Nli.append((b-2-li[n])*(H-2)+(a-2-li[m]))
import collections
s = collections.Counter(Nli)
v = list(s.values())
print((H-2)*(W-2)-len(set(Nli)))
for k in range(1,10):
    print(v.count(k))

Fixed submission:
H,W,N = map(int,input().split())
Nli=[]
for k in range(N):
    a,b=map(int,input().split())
    for n in range(-1,2):
        for m in range(-1,2):
            if 0<=a-2-m<H-2 and 0<=b-2-n<W-2:
                Nli.append((b-n)*(H)+(a-m))
import collections
s = collections.Counter(Nli)
v = list(s.values())
print((H-2)*(W-2)-len(set(Nli)))
for k in range(1,10):
    print(v.count(k))

Buggy python submission (verdict: Time Limit Exceeded):
H,W,N = map(int,input().split())
B=[[0 for k in range(W-2)] for j in range(H-2)]
li=[-1,0,1]
for k in range(N):
    a,b=map(int,input().split())
    for n in range(3):
        for m in range(3):
            if 0<=a-2-li[m]<H-2 and 0<=b-2-li[n]<W-2:
                B[a-2-li[m]][b-2-li[n]]+=1
for k in range(10):
    c=0
    for j in range(H-2):
        c+=B[j].count(k)
    print(c)


Fixed submission:
H,W,N = map(int,input().split())
Nli=[]
for k in range(N):
    a,b=map(int,input().split())
    for n in range(-1,2):
        for m in range(-1,2):
            if 0<=a-2-m<H-2 and 0<=b-2-n<W-2:
                Nli.append((b-n)*(H)+(a-m))
import collections
s = collections.Counter(Nli)
v = list(s.values())
print((H-2)*(W-2)-len(set(Nli)))
for k in range(1,10):
    print(v.count(k))

Buggy python submission (verdict: Time Limit Exceeded):
H,W,N = map(int,input().split())
B=[[0 for k in range(W-2)] for j in range(H-2)]
li=[-1,0,1]
for k in range(N):
    a,b=map(int,input().split())
    for n in range(3):
        for m in range(3):
            if 0<=a-2-li[m]<H-2 and 0<=b-2-li[n]<W-2:
                B[a-2-li[m]][b-2-li[n]]+=1
for k in range(10):
    c=0
    for j in range(H-2):
        c+=B[j].count(k)
    print(c)


Fixed submission:
H,W,N = map(int,input().split())
Nli=[]
for k in range(N):
    a,b=map(int,input().split())
    for n in range(-1,2):
        for m in range(-1,2):
            if 0<=a-2-m<H-2 and 0<=b-2-n<W-2:
                Nli.append((b-n)*(H)+(a-m))
import collections
s = collections.Counter(Nli)
v = list(s.values())
print((H-2)*(W-2)-len(set(Nli)))
for k in range(1,10):
    print(v.count(k))