Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
H,W,N = [int(n) for n in input().split()]
# N = int(input())
dxy = [[0,0],[1,0],[0,1],
[-1,0],[0,-1],[1,1],
[-1,-1], [1,-1], [-1,1]]

effdic = defaultdict(int)
for i in range(N):
    a,b = [int(n)-1 for n in input().split()]
    for d in dxy:
        ta, tb = a+d[0], b+d[1]
        if(1 <= ta < H-1 and 1 <= tb < W-1):
            s = str(ta) + str(tb)
            effdic[s] += 1
ans = {0:(H-2)*(W-2), 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0}
for k in effdic.keys():
    ans[effdic[k]]+=1
    ans[0]-=1
for k in ans.keys():
    print(ans[k])


Fixed submission:
from collections import defaultdict
H,W,N = [int(n) for n in input().split()]
# N = int(input())
dxy = [[0,0],[1,0],[0,1],
[-1,0],[0,-1],[1,1],
[-1,-1], [1,-1], [-1,1]]

effdic = defaultdict(int)
for i in range(N):
    a,b = [int(n)-1 for n in input().split()]
    for d in dxy:
        ta, tb = a+d[0], b+d[1]
        if(1 <= ta < H-1 and 1 <= tb < W-1):
            effdic[(ta,tb)] += 1
print((H-2)*(W-2) - len(effdic))
for i in range(1,10):
    tmp=0
    for v in effdic.values():
        if(v == i):
            tmp+=1
    print(tmp)

Buggy python submission (verdict: Runtime Error):
from sys import exit
H,W,N = [int(n) for n in input().split()]
# N = int(input())
dxy = [[0,0],[1,0],[0,1],
[-1,0],[0,-1],[1,1],
[-1,-1], [1,-1], [-1,1]]

effdic = {}
for i in range(N):
    a,b = [int(n)-1 for n in input().split()]
    for d in dxy:
        ta, tb = a+d[0], b+d[1]
        if(1 <= ta < H-1 and 1 <= tb < W-1):
            s = str(ta) + str(tb)
            if(s in effdic):
                effdic[s] += 1
            else:
                effdic[s] = 1

ans = {0:(H-2)*(W-2), 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0}
for k in effdic.keys():
    ans[effdic[k]]+=1
    ans[0]-=1
for k in ans.keys():
    print(ans[k])
# S = str(input())
# L = len(S)
# T = str(input())
# exit()


Fixed submission:
from collections import defaultdict
H,W,N = [int(n) for n in input().split()]
# N = int(input())
dxy = [[0,0],[1,0],[0,1],
[-1,0],[0,-1],[1,1],
[-1,-1], [1,-1], [-1,1]]

effdic = defaultdict(int)
for i in range(N):
    a,b = [int(n)-1 for n in input().split()]
    for d in dxy:
        ta, tb = a+d[0], b+d[1]
        if(1 <= ta < H-1 and 1 <= tb < W-1):
            effdic[(ta,tb)] += 1
print((H-2)*(W-2) - len(effdic))
for i in range(1,10):
    tmp=0
    for v in effdic.values():
        if(v == i):
            tmp+=1
    print(tmp)

Buggy python submission (verdict: Runtime Error):
from sys import exit
H,W,N = [int(n) for n in input().split()]
dxy = [[1,0],[0,1],[-1,0],[0,-1],[1,-1],[-1,1],[1,1],[-1,-1],[0,0]]
# ansdic = {0:(H-2)*(W-2),1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0}
ansdic = {}
# memo = [[0 for _ in range(W-1)] for __ in range(H-1)]
# print(memo)

for i in range(N):
    ab = [int(n) for n in input().split()]
    ab[0]-=1
    ab[1]-=1
    for d in dxy:
        per = [ab[0] + d[0],ab[1] + d[1]]
        if(1 <= per[0] <= H-2 and 1 <= per[1] <= W-2):
            rep = "".join([str(per[0]),str(per[1])])

            if not rep in ansdic:
                ansdic[rep] = 1
            else:
                ansdic[rep] +=1
            # ansdic[memo[per[0]][per[1]]]-=1
            # memo[per[0]][per[1]]+=1
            # ansdic[memo[per[0]][per[1]]]+=1
ans = {0:(H-2)*(W-2),1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0}
for k in ansdic.keys():
    ans[ansdic[k]]+=1
    ans[0]-=1
for k in ans.keys():
    print(ans[k])
# S = str(input())
# L = len(S)
# T = str(input())
exit()


Fixed submission:
from collections import defaultdict
H,W,N = [int(n) for n in input().split()]
# N = int(input())
dxy = [[0,0],[1,0],[0,1],
[-1,0],[0,-1],[1,1],
[-1,-1], [1,-1], [-1,1]]

effdic = defaultdict(int)
for i in range(N):
    a,b = [int(n)-1 for n in input().split()]
    for d in dxy:
        ta, tb = a+d[0], b+d[1]
        if(1 <= ta < H-1 and 1 <= tb < W-1):
            effdic[(ta,tb)] += 1
print((H-2)*(W-2) - len(effdic))
for i in range(1,10):
    tmp=0
    for v in effdic.values():
        if(v == i):
            tmp+=1
    print(tmp)