CodeEff/ECCO huggingface dataset:
# Original solution
h, w, n = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(n)]

from collections import defaultdict
d = defaultdict(int)

dp = [0] * 10
dp[0] = (h - 2) * (w - 2)
for i in range(n):
    a = ab[i][0] - 1
    b = ab[i][1] - 1
    for dx in [-1, 0, 1]:
        for dy in [-1, 0, 1]:
            nx, ny = a + dx, b + dy # center
            if nx >= 1 and nx <= h - 2 and ny >= 1 and ny <= w - 2:
                # print(nx, ny)
                tmp = 0
                for dx2 in [-1, 0, 1]:
                    for dy2 in [-1, 0, 1]:
                        if d[str(nx + dx2) + ' ' + str(ny + dy2)] == 1:
                            tmp += 1

                dp[tmp] -= 1
                dp[tmp + 1] += 1
    d[str(a) + ' ' + str(b)] = 1
    # print(dp)

for d in dp:
    print(d)


# Optimized solution
h, w, n = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(n)]

d = dict()
for i in range(len(ab)):
    a = ab[i][0] - 1
    b = ab[i][0] - 1
    d[a] = set()

dp = [0] * 10
dp[0] = (h - 2) * (w - 2)
for i in range(n):
    a = ab[i][0] - 1
    b = ab[i][1] - 1
    for dx in [-1, 0, 1]:
        for dy in [-1, 0, 1]:
            nx, ny = a + dx, b + dy # center
            if nx >= 1 and nx <= h - 2 and ny >= 1 and ny <= w - 2:
                # print(nx, ny)
                tmp = 0
                for dx2 in [-1, 0, 1]:
                    for dy2 in [-1, 0, 1]:
                        if nx + dx2 in d and ny + dy2 in d[nx + dx2]:
                            tmp += 1

                dp[tmp] -= 1
                dp[tmp + 1] += 1

    d[a].add(b)

for x in dp:
    print(x)
# Original solution
from collections import defaultdict
H, W, N, *L = map(int, open(0).read().split())
dic = defaultdict(int)
for a, b in zip(*[iter(L)]*2):
  for i in range(a-2,a+1):
    for j in range(b-2,b+1):
      if 0<i and i+2<=H and 0<j and j+2<=W:
        dic[(i,j)] += 1
ans = [0]*10
ans[0] = (W-2)*(H-2)
for k in dic.keys():
  ans[dic[k]] += 1
  ans[0] -= 1
print(*ans,sep='\n')


# Optimized solution
H, W, N, *L = list(map(int, open(0).read().split()))
dic = {}
for a, b in zip(*[iter(L)]*2):
  for i in range(a-2,a+1):
    for j in range(b-2,b+1):
      if 0<i and i+2<=H and 0<j and j+2<=W:
        dic[i*W+j] = dic.get(i*W+j,0)+1
ans = [0]*10
ans[0] = (W-2)*(H-2)
for k in list(dic.keys()):
  ans[dic[k]] += 1
  ans[0] -= 1
print(('\n'.join(map(str,ans))))
# Original solution
import sys
from collections import deque

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    H, W, n = map(int, input().split())
    AB = set(tuple(tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(n)))

    d = ((1, 1), (1, 0), (1, -1), (0, 1), (0, 0), (0, -1), (-1, 1), (-1, 0), (-1, -1))
    total = (H - 2) * (W - 2)
    res = [0] * 10
    used = set()
    for a, b in AB:
        if (a, b) in used:
            continue
        que = deque([(a, b)])
        while que:
            h, w = que.popleft()
            if (h, w) in used:
                continue
            used.add((h, w))
            cnt = 0
            flg = True
            tmp = []
            for dh, dw in d:
                next_h, next_w = h + dh, w + dw
                if next_h < 0 or next_h >= H or next_w < 0 or next_w >= W:
                    flg = False
                else:
                    if (next_h, next_w) in AB:
                        cnt += 1
                    if (next_h, next_w) not in used:
                        tmp.append((next_h, next_w))
            if flg and cnt:
                res[cnt] += 1
            if cnt:
                for next_h, next_w in tmp:
                    que.append((next_h, next_w))
    res[0] = total - sum(res)
    print(*res, sep="\n")


if __name__ == '__main__':
    resolve()


# Optimized solution
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    H, W, n = map(int, input().split())
    AB = set(tuple(tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(n)))

    d = ((1, 1), (1, 0), (1, -1), (0, 1), (0, 0), (0, -1), (-1, 1), (-1, 0), (-1, -1))
    target = set()
    res = [0] * 10
    for h, w in AB:
        cnt = 0
        flg = True
        for dh, dw in d:
            next_h, next_w = h + dh, w + dw
            if next_h < 0 or next_h >= H or next_w < 0 or next_w >= W:
                flg = False
            if (next_h, next_w) in AB:
                cnt += 1
            else:
                target.add((next_h, next_w))
        if flg:
            res[cnt] += 1

    for h, w in target:
        cnt = 0
        for dh, dw in d:
            next_h, next_w = h + dh, w + dw
            if next_h < 0 or next_h >= H or next_w < 0 or next_w >= W:
                break
            if (next_h, next_w) in AB:
                cnt += 1
        else:
            res[cnt] += 1

    total = (H - 2) * (W - 2)
    res[0] = total - sum(res)
    print(*res, sep="\n")


if __name__ == '__main__':
    resolve()
# Original solution
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    H, W, n = map(int, input().split())
    AB = set(tuple(tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(n)))

    d = ((1, 1), (1, 0), (1, -1), (0, 1), (0, 0), (0, -1), (-1, 1), (-1, 0), (-1, -1))
    target = set()
    res = [0] * 10
    for h, w in AB:
        cnt = 0
        flg = True
        for dh, dw in d:
            next_h, next_w = h + dh, w + dw
            if next_h < 0 or next_h >= H or next_w < 0 or next_w >= W:
                flg = False
            if (next_h, next_w) in AB:
                cnt += 1
            else:
                if (next_h, next_w) != (h, w):
                    target.add((next_h, next_w))
        if flg:
            res[cnt] += 1

    for h, w in target:
        cnt = 0
        for dh, dw in d:
            next_h, next_w = h + dh, w + dw
            if next_h < 0 or next_h >= H or next_w < 0 or next_w >= W:
                break
            if (next_h, next_w) in AB:
                cnt += 1
        else:
            res[cnt] += 1

    total = (H - 2) * (W - 2)
    res[0] = total - sum(res)
    print(*res, sep="\n")


if __name__ == '__main__':
    resolve()


# Optimized solution
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    H, W, n = map(int, input().split())
    AB = set(tuple(tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(n)))

    d = ((1, 1), (1, 0), (1, -1), (0, 1), (0, 0), (0, -1), (-1, 1), (-1, 0), (-1, -1))
    target = set()
    res = [0] * 10
    for h, w in AB:
        cnt = 0
        flg = True
        for dh, dw in d:
            next_h, next_w = h + dh, w + dw
            if next_h < 0 or next_h >= H or next_w < 0 or next_w >= W:
                flg = False
            if (next_h, next_w) in AB:
                cnt += 1
            else:
                if (next_h, next_w) not in AB:
                    target.add((next_h, next_w))
        if flg:
            res[cnt] += 1

    for h, w in target:
        cnt = 0
        for dh, dw in d:
            next_h, next_w = h + dh, w + dw
            if next_h < 0 or next_h >= H or next_w < 0 or next_w >= W:
                break
            if (next_h, next_w) in AB:
                cnt += 1
        else:
            res[cnt] += 1

    total = (H - 2) * (W - 2)
    res[0] = total - sum(res)
    print(*res, sep="\n")


if __name__ == '__main__':
    resolve()
# Original solution
import sys
from collections import defaultdict

def input():
    return sys.stdin.readline().strip()

def recordnum(a,b):
    if not (0 < a < H-1 and 0 < b < W-1):
        return 

    res = M[(a,b)]
    for i,j in vector:
        res += M[(a+i,b+j)]
    num[res] += 1
    return

def dfs(a,b,color):

    if visited[(a,b)]:
        return

    recordnum(a,b)
    visited[(a,b)] = True

    if color == "b":
        for i,j in vector:
            x = a+i
            y = b+j
            if 0 < x < H-1 and 0 < y < W-1 and M[(x,y)] == 0:
                dfs(x,y,"w")
    return

    

H,W,N = list(map(int,input().split()))

M = defaultdict(int)
visited = defaultdict(int)
ab = []

for _ in range(N):
    a,b = list(map(int,input().split()))
    ab.append((a-1,b-1))
    M[(a-1,b-1)] = 1


vector = [(0,1),(0,-1),(1,0),(-1,0),(1,1),(-1,-1),(1,-1),(-1,1)]
num = [0]*10

for a,b in ab:
    dfs(a,b,"b")

num[0] = (H-2)*(W-2) - sum(num)

for i in num:
    print(i)

# Optimized solution
"""
参考(神様)
https://atcoder.jp/contests/abc045/submissions/6046010
"""

###かぶるやつを考える.例えばあるマスのかぶり値が9だとしたら,
###周囲はすべて黒->j=9のが1つとカウントしてよい,他の値についても同様.

import sys
from collections import defaultdict,Counter

def input():
    return sys.stdin.readline().strip()

H,W,N = list(map(int,input().split()))

covered = defaultdict(int)
vector = [(0,0),(0,1),(0,-1),(1,0),(-1,0),(1,1),(-1,-1),(1,-1),(-1,1)]

for _ in range(N):
    a,b = list(map(int,input().split()))

    for i,j in vector:
        x = a+i-1
        y = b+j-1

        if 0 < x < H-1 and 0 < y < W-1:
            covered[(x,y)] += 1

num = Counter(list(covered.values()))
##print(num)
num[0] = (H-2)*(W-2)-sum(num.values())

for i in range(10):
    print((num[i]))
# Original solution
"""
参考(神様)
https://atcoder.jp/contests/abc045/submissions/6046010
"""

###かぶるやつを考える.例えばあるマスのかぶり値が9だとしたら,
###周囲はすべて黒->j=9のが1つとカウントしてよい,他の値についても同様.

import sys
from collections import defaultdict,Counter

def input():
    return sys.stdin.readline().strip()

H,W,N = list(map(int,input().split()))

covered = defaultdict(int)
vector = [(0,0),(0,1),(0,-1),(1,0),(-1,0),(1,1),(-1,-1),(1,-1),(-1,1)]

for _ in range(N):
    a,b = list(map(int,input().split()))

    for i,j in vector:
        x = a+i-1
        y = b+j-1

        if 0 < x < H-1 and 0 < y < W-1:
            covered[(x,y)] += 1

num = Counter(list(covered.values()))
##print(num)
num[0] = (H-2)*(W-2)-sum(num.values())

for i in range(10):
    print((num[i]))

# Optimized solution
from collections import defaultdict
from itertools import product

H,W,N = list(map(int,input().split()))

covered = defaultdict(int)
vector = [[-1,-1],[-1,0],[-1,1],[1,0],[1,1],[0,0],[0,-1],[0,1],[1,-1]]

for _ in range(N):
    a,b = list(map(int,input().split()))
    for dx,dy in vector:
        x = a+dx-1
        y = b+dy-1
        if 1 <= x < H-1 and 1 <= y < W-1:
            covered[(x,y)] += 1

values = [0]*10
for i in list(covered.values()):
    values[i] += 1

values[0] = (H-2)*(W-2) - sum(values)

for v in values:
    print(v)
# Original solution
h,w,n=list(map(int,input().split()))
ab=[list(map(int,input().split())) for _ in [0]*n]

ab_d={a*(10**6)+b for a,b in ab}

ans=[set() for _ in range(9)]
for a,b in ab:
    temp=[[2 for _ in [0]*5] for _ in [0]*5]
    for i in range(5):
        for j in range(5):
            if 0<a+i-2<=h and 0<b+j-2<=w:
                if (a+i-2)*(10**6)+b+j-2 in ab_d:
                    temp[i][j]=1
                else:
                    temp[i][j]=0
    for i in range(3):
        for j in range(3):
            cnt=[temp[i+k][j+l] for k in range(3) for l in range(3)]
            if 2 not in cnt:
                ans[sum(cnt)-1].add((a+i-2)*(10**6)+b+j-2)
                
for i in range(9):
    ans[i]=len(ans[i])

print(((h-2)*(w-2)-sum(ans)))
for i in ans:
    print(i)

# Optimized solution
h,w,n=list(map(int,input().split()))
ab=[list(map(int,input().split())) for _ in [0]*n]
ab_d={a*(10**10)+b for a,b in ab}

ans=[set() for _ in range(9)]
for a,b in ab:
    temp=[None for _ in [0]*25]
    for i in range(5):
        for j in range(5):
            if 0<a+i-2<=h and 0<b+j-2<=w:
                if (a+i-2)*(10**10)+b+j-2 in ab_d:
                    temp[i*5+j]=1
                else:
                    temp[i*5+j]=0
    for i in range(3):
        for j in range(3):
            cnt=[temp[(i+k)*5+j+l] for k in range(3) for l in range(3)]
            if None not in cnt:
                ans[sum(cnt)-1].add((a+i-2)*(10**10)+b+j-2)
                
for i in range(9):
    ans[i]=len(ans[i])

print(((h-2)*(w-2)-sum(ans)))
for i in ans:
    print(i)
# Original solution
h,w,n=list(map(int,input().split()))
jl=[0]*10
ab=[]
if n==0:
  print(((w-2)*(h-2)))
  for i in range(9):
    print((0))
  exit()
for i in range(n):
  a,b=list(map(int,input().split()))
  a-=1
  b-=1
  for j in range(max(0,b-2),min(w-2,b+1)):
    for k in range(max(0,a-2),min(h-2,a+1)):
      ab=ab+[[k,j]]

ab.sort(key=lambda x: x[1])
ab.sort()
flag=False
count=1
now=ab[0]
for i in ab[1:]:
  if i==now:
    count+=1
  else:
    jl[count]+=1
    count=1
    now=i
jl[count]+=1
jl[0]=(h-2)*(w-2)-sum(jl[1:])
for i in range(10):
  print((jl[i]))

# Optimized solution
h,w,n=list(map(int,input().split()))
jl=[0]*10
cnt={}
if n==0:
  print(((w-2)*(h-2)))
  for i in range(9):
    print((0))
  exit()
for i in range(n):
  a,b=list(map(int,input().split()))
  a-=1
  b-=1
  for j in range(max(0,b-2),min(w-2,b+1)):
    for k in range(max(0,a-2),min(h-2,a+1)):
      if (k, j) in cnt:
        cnt[(k, j)]+=1
      else:
        cnt[(k, j)]=1
jl[0]=(h-2)*(w-2)
for i in list(cnt.values()):
  jl[0]-=1
  jl[i]+=1
for i in jl:
  print(i)
# Original solution
from collections import defaultdict


def main():
    H, W, N = map(int, input().split())

    d = defaultdict(int)
    for _ in range(N):
        a, b = map(int, input().split())
        for y in range(-2, 1):
            for x in range(-2, 1):
                n_y, n_x = y + a, x + b
                if 0 < n_y <= H - 2 and 0 < n_x <= W - 2:
                    d[(n_y, n_x)] += 1

    ans = [0] * 10
    for k, v in d.items():
        ans[v] += 1
    ans[0] = (H - 2) * (W - 2) - sum(ans)

    print(*ans, sep="\n")

if __name__ == '__main__':
    main()


# Optimized solution
from collections import defaultdict


def main():
    H, W, N = map(int, input().split())
    d = defaultdict(int)
    for _ in range(N):
        a, b = map(int, input().split())
        a, b = a - 1, b - 1
        for y in range(-2, 1):
            for x in range(-2, 1):
                ny, nx = a + y, b + x
                if 0 <= ny < H - 2 and 0 <= nx < W - 2:
                    d[(ny, nx)] += 1
    ans = [0] * 10
    for v in d.values():
        ans[v] += 1
    ans[0] = (H - 2) * (W - 2) - sum(ans)

    print(*ans, sep="\n")

if __name__ == '__main__':
    main()
# Original solution
from collections import Counter

H, W, N, *AB = list(map(int, open(0).read().split()))

C = Counter()
for a, b in zip(*[iter(AB)] * 2):
    C.update(
        (a - i, b - j)
        for i in range(-1, 2) for j in range(-1, 2)
        if 2 <= a - i <= H - 1 and 2 <= b - j <= W - 1
    )

D = Counter(v for _, v in list(C.items()))

print(((H - 2) * (W - 2) - sum(D.values())))
for i in range(1, 10):
    print((D[i]))


# Optimized solution
from collections import Counter
from itertools import product

H, W, N, *AB = list(map(int, open(0).read().split()))

C = Counter()
for a, b in zip(*[iter(AB)] * 2):
    C.update(
        (a - i, b - j)
        for i, j in product((-1, 0, 1), repeat=2)
        if 2 <= a - i <= H - 1 and 2 <= b - j <= W - 1
    )

D = Counter(v for _, v in list(C.items()))

print(((H - 2) * (W - 2) - sum(D.values())))
for i in range(1, 10):
    print((D[i]))
# Original solution
from collections import Counter
from itertools import product

H, W, N, *AB = list(map(int, open(0).read().split()))

move = [
    (-1, -1), (-1, 0), (-1, 1),
    (0, -1),  (0, 0),  (0, 1),
    (1, -1),  (1, 0),  (1, 1),
]

C = Counter()
for a, b in zip(*[iter(AB)] * 2):
    C.update(
        (a - i, b - j)
        for i, j in move
        if 2 <= a - i <= H - 1 and 2 <= b - j <= W - 1
    )

D = Counter(v for _, v in list(C.items()))

print(((H - 2) * (W - 2) - sum(D.values())))
for i in range(1, 10):
    print((D[i]))


# Optimized solution
from collections import Counter

H, W, N, *AB = list(map(int, open(0).read().split()))

move = [
    (-1, -1), (-1, 0), (-1, 1),
    (0, -1),  (0, 0),  (0, 1),
    (1, -1),  (1, 0),  (1, 1),
]

C = Counter()
for a, b in zip(*[iter(AB)] * 2):
    C.update(
        (a - i, b - j)
        for i, j in move
        if 2 <= a - i <= H - 1 and 2 <= b - j <= W - 1
    )

D = Counter(v for _, v in list(C.items()))

print(((H - 2) * (W - 2) - sum(D.values())))
for i in range(1, 10):
    print((D[i]))
# Original solution
from collections import Counter

H, W, N, *AB = list(map(int, open(0).read().split()))

move = [
    (-1, -1), (-1, 0), (-1, 1),
    (0, -1),  (0, 0),  (0, 1),
    (1, -1),  (1, 0),  (1, 1),
]

C = Counter()
for a, b in zip(*[iter(AB)] * 2):
    C.update(
        (a - i, b - j)
        for i, j in move
        if 2 <= a - i <= H - 1 and 2 <= b - j <= W - 1
    )

D = [0] * 10
for v in list(C.values()):
    D[v] += 1

D[0] = (H - 2) * (W - 2) - len(C)
print(("\n".join(map(str, D))))


# Optimized solution
from collections import Counter

H, W, N, *AB = list(map(int, open(0).read().split()))

move = [
    (-1, -1), (-1, 0), (-1, 1),
    (0, -1),  (0, 0),  (0, 1),
    (1, -1),  (1, 0),  (1, 1),
]

C = Counter()
for a, b in zip(*[iter(AB)] * 2):
    C.update(
        (a - i, b - j)
        for i, j in move
        if 2 <= a - i <= H - 1 and 2 <= b - j <= W - 1
    )

D = [0] * 10
for v in list(C.values()):
    D[v] += 1

D[0] = (H - 2) * (W - 2) - len(C)
for d in D:
    print(d)
# Original solution
import itertools
from collections import defaultdict
H,W,N=list(map(int, input().split()))

d=[-1,0,1]
D=list(itertools.product(d,d))

C=set()	#Center
A=defaultdict(lambda: 0)
for i in range(N):
	a,b=list(map(int, input().split()))
	A[(a,b)]=1
	for dx,dy in D:
		cx=a+dx
		cy=b+dy
		if cx>=2 and cx<=H-1 and cy>=2 and cy<=W-1:
			C.add( (cx,cy) )

l=defaultdict(lambda: 0)

for x,y in C:
	cnt=0
	for i,j in D:
		if A[(x+i,y+j)]==1:
			cnt+=1
	l[cnt]+=1



for i in range(10):
	if i==0:
		print((H-2)*(W-2)-sum(l.values()))
	else:
		print(l[i])




# Optimized solution
import itertools
from collections import defaultdict
from collections import Counter
H,W,N=list(map(int, input().split()))

d=[-1,0,1]
D=list(itertools.product(d,d))

A=defaultdict(lambda: 0)
for i in range(N):
	a,b=list(map(int, input().split()))
	for dx,dy in D:
		cx=a+dx
		cy=b+dy
		if cx>=2 and cx<=H-1 and cy>=2 and cy<=W-1:
			A[(cx,cy)]+=1

C=Counter(list(A.values()))


for i in range(10):
	if i==0:
		print((H-2)*(W-2)-sum(C.values()))
	else:
		print(C[i])
# Original solution
H,W,N = list(map(int,input().split()))
Nli=[]
for k in range(N):
    a,b=list(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)))

# Optimized solution
H,W,N = list(map(int,input().split()))
Nli=[0 for j in range(9*N)]
q=0
for k in range(N):
    a,b=list(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[q]=(b-n)*(H)+(a-m)
                q+=1
del Nli[q:]
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)))
# Original solution
H,W,N = list(map(int,input().split()))

from collections import defaultdict
t =defaultdict(int)
L = defaultdict(int)

for i in range(N):
    a,b = list(map(int,input().split()))
    t[(a-1,b-1)] = 1
    for p in [-1,0,1]:
        for q in [-1,0,1]:
            if a+p < 2 or b+q < 2 or a+p >H-1 or b+q >W-1:
                continue
            L[(a+p-1,b+q-1)] = 1



ans = [0]*10
for k in list(L.keys()):
    a,b = k[0],k[1]
    if a < 1 or b < 1 or a >H-2 or b >W-2:
        continue

    c = 0
    for p in [-1,0,1]:
        for q in [-1,0,1]:
            c +=t[(a+p,b+q)]

    ans[c] += 1

ans[0] = (H-2)*(W-2) - sum(ans)
for i in range(10):
    print((ans[i]))


# Optimized solution
H,W,N = list(map(int,input().split()))

from collections import defaultdict
t =defaultdict(int)
L = defaultdict(int)

for i in range(N):
    a,b = list(map(int,input().split()))
    t[(a-1,b-1)] = 1
    for p in [-1,0,1]:
        for q in [-1,0,1]:
            if a+p < 2 or b+q < 2 or a+p >H-1 or b+q >W-1:
                continue
            L[(a+p-1,b+q-1)] += 1
ans = [0]*10
for v in list(L.values()):
    ans[v] += 1

ans[0] = (H-2)*(W-2) - sum(ans)
for i in range(10):
    print((ans[i]))
# Original solution
H,W,N = list(map(int,input().split()))

from collections import defaultdict
t =defaultdict(int)
L = defaultdict(int)

for i in range(N):
    a,b = list(map(int,input().split()))
    t[(a-1,b-1)] = 1
    for p in [-1,0,1]:
        for q in [-1,0,1]:
            if a+p < 2 or b+q < 2 or a+p >H-1 or b+q >W-1:
                continue
            L[(a+p-1,b+q-1)] += 1
ans = [0]*10
for v in list(L.values()):
    ans[v] += 1

ans[0] = (H-2)*(W-2) - sum(ans)
for i in range(10):
    print((ans[i]))


# Optimized solution
H,W,N = list(map(int,input().split()))

from collections import defaultdict
L = defaultdict(int)

for i in range(N):
    a,b = list(map(int,input().split()))
    for p in [-1,0,1]:
        for q in [-1,0,1]:
            if a+p < 2 or b+q < 2 or a+p >H-1 or b+q >W-1:
                continue
            L[(a+p-1,b+q-1)] += 1
            
ans = [0]*10
for v in list(L.values()):
    ans[v] += 1
ans[0] = (H-2)*(W-2) - sum(ans)

for i in range(10):
    print((ans[i]))
# Original solution
H,W,N = list(map(int,input().split()))

from collections import defaultdict
L = defaultdict(int)

for i in range(N):
    a,b = list(map(int,input().split()))
    for p in [-1,0,1]:
        for q in [-1,0,1]:
            if a+p < 2 or b+q < 2 or a+p >H-1 or b+q >W-1:
                continue
            L[(a+p-1,b+q-1)] += 1
            
ans = [0]*10
for v in list(L.values()):
    ans[v] += 1
ans[0] = (H-2)*(W-2) - sum(ans)

for i in range(10):
    print((ans[i]))


# Optimized solution
H,W,N = list(map(int,input().split()))

from collections import defaultdict
L = defaultdict(int)

#黒く塗りつぶしたマスとその周りだけ探索すればよい
for i in range(N):
    a,b = list(map(int,input().split()))
    for p in [-1,0,1]:
        for q in [-1,0,1]:
            if a+p < 2 or b+q < 2 or a+p >H-1 or b+q >W-1:
                continue
            L[(a+p-1,b+q-1)] += 1
            
ans = [0]*10
for v in list(L.values()):
    ans[v] += 1
ans[0] = (H-2)*(W-2) - sum(ans)

for i in range(10):
    print((ans[i]))
# Original solution
H, W, N = list(map(int, input().split()))


graph = {}
for _ in range(N):
    a, b = list(map(int, input().split()))
    for i in [-1, 0, 1]:
        for j in [-1, 0, 1]:
            na, nb = a-1+i, b-1+j
            if 1 <= na <= H-2 and 1 <= nb <= W-2:
                if not graph.get(na, False):
                    graph[na] = {nb: 1}
                elif not graph[na].get(nb, False):
                    graph[na][nb] = 1
                else:
                    graph[na][nb] += 1
#print(graph)
ans = [0 for _ in range(10)]
S = 0
for a, v_graph in list(graph.items()):
    for b, v in list(v_graph.items()):
        ans[v] += 1
        S += 1
ans[0] = (H-2)*(W-2) - S
for a in ans:
    print(a)

# Optimized solution
H, W, N = list(map(int, input().split()))


graph = {}
for _ in range(N):
    a, b = list(map(int, input().split()))
    for i in [-1, 0, 1]:
        for j in [-1, 0, 1]:
            na, nb = a-1+i, b-1+j
            if 1 <= na <= H-2 and 1 <= nb <= W-2:
                if not na in list(graph.keys()):
                    graph[na] = {nb: 1}
                elif not nb in list(graph[na].keys()):
                    graph[na][nb] = 1
                else:
                    graph[na][nb] += 1
#print(graph)
ans = [0 for _ in range(10)]
S = 0
for a, v_graph in list(graph.items()):
    for b, v in list(v_graph.items()):
        ans[v] += 1
        S += 1
ans[0] = (H-2)*(W-2) - S
for a in ans:
    print(a)