AtCoder Beginner Contest 045 - Snuke's Coloring

We have a grid with H rows and W columns. At first, all cells were painted white.
Snuke painted N of these cells. The i-th ( 1 \leq i \leq N ) cell he painted is the cell at the a_i-th row and b_i-th column.
Compute the following:
 - For each integer j ( 0 \leq j \leq 9 ), how many subrectangles of size 3×3 of the grid contains exactly j black cells, after Snuke painted N cells?

-----Constraints-----
 - 3 \leq H \leq 10^9
 - 3 \leq W \leq 10^9
 - 0 \leq N \leq min(10^5,H×W)
 - 1 \leq a_i \leq H (1 \leq i \leq N)
 - 1 \leq b_i \leq W (1 \leq i \leq N)
 - (a_i, b_i) \neq (a_j, b_j) (i \neq j)

-----Input-----
The input is given from Standard Input in the following format:
H W N
a_1 b_1
:
a_N b_N

-----Output-----
Print 10 lines.
The (j+1)-th ( 0 \leq j \leq 9 ) line should contain the number of the subrectangles of size 3×3 of the grid that contains exactly j black cells.

-----Sample Input-----
4 5 8
1 1
1 4
1 5
2 3
3 1
3 2
3 4
4 4

-----Sample Output-----
0
0
0
2
4
0
0
0
0
0


There are six subrectangles of size 3×3. Two of them contain three black cells each, and the remaining four contain four black cells each.

Difficulty: MEDIUM

Starter code:

Solutions:
import sys

def input():
	return sys.stdin.readline()[:-1]
(H, W, N) = map(int, input().split())
d = {}
for i in range(N):
	(a, b) = map(int, input().split())
	for j in range(-1, 2):
		if not 1 < a + j < H:
			continue
		for k in range(-1, 2):
			if not 1 < b + k < W:
				continue
			t = (a + j, b + k)
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
l = [0] * 10
for i in d.values():
	l[i] += 1
l[0] = (H - 2) * (W - 2) - sum(l)
print(*l, sep='\n')


import sys
input = sys.stdin.readline
from collections import Counter
(h, w, n) = map(int, input().split())
c = Counter()
for _ in range(n):
	(b, a) = map(int, input().split())
	for i in [-1, 0, 1]:
		for j in [-1, 0, 1]:
			if 2 <= a + i < w and 2 <= b + j < h:
				c[a + i, b + j] += 1
c2 = Counter(c.values())
print((h - 2) * (w - 2) - sum(c2.values()))
for i in range(1, 10):
	print(c2[i])


from itertools import product
(h, w, n) = list(map(int, input().split()))
idxs = {}
ans = [0] * 10
for i in range(n):
	(a, b) = list(map(int, input().split()))
	for (a_, b_) in product(range(a - 1, a + 2), range(b - 1, b + 2)):
		if a_ <= 1 or b_ <= 1 or a_ >= h or (b_ >= w):
			continue
		if (a_, b_) not in idxs.keys():
			idxs[a_, b_] = 1
		else:
			idxs[a_, b_] += 1
for (keys, item) in idxs.items():
	ans[item] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans[1:])
for a in ans:
	print(a)


(h, w, n) = map(int, input().split())
d = {}
for _ in range(n):
	(a, b) = map(int, input().split())
	for i in (-1, 0, 1):
		for j in (-1, 0, 1):
			if 2 <= a + i <= h - 1 and 2 <= b + j <= w - 1:
				d.setdefault((a + i, b + j), 0)
				d[a + i, b + j] += 1
r = [0] * 10
for i in d.values():
	r[i] += 1
r[0] = (h - 2) * (w - 2) - sum(r)
for i in r:
	print(i)


from collections import Counter
(H, W, N) = [int(v) for v in input().split()]
square_list = []
for i in range(N):
	(a, b) = [int(v) for v in input().split()]
	for p in range(3):
		for q in range(3):
			if 1 <= a - p <= H - 2 and 1 <= b - q <= W - 2:
				square_list.append((a - p, b - q))
square_cnt = Counter(square_list)
ans = {i: 0 for i in range(10)}
ans[0] = (H - 2) * (W - 2) - len(square_cnt)
for cnt in square_cnt.values():
	ans[cnt] += 1
for k in sorted(ans.keys()):
	print(ans[k])


(H, W, N) = list(map(int, input().split()))
from bisect import bisect_left
from bisect import bisect_right
matrix = []
for _ in range(N):
	(x, y) = list(map(int, input().split()))
	x -= 1
	y -= 1
	matrix.append([x, y])
matrix.sort()
ans = [0 for _ in range(10)]
cand = {}
for l in matrix:
	for x_r in [-2, -1, 0]:
		for y_r in [-2, -1, 0]:
			nowx = l[0] + x_r
			nowy = l[1] + y_r
			if nowx < 0 or nowy < 0 or nowx + 2 >= H or (nowy + 2 >= W):
				continue
			name = str(nowx) + ' ' + str(nowy)
			if name in cand:
				cand[name] += 1
			else:
				cand[name] = 1
tmp = (H - 2) * (W - 2)
for x in list(cand.values()):
	ans[x] += 1
	tmp -= 1
ans[0] = tmp
for x in ans:
	print(x)


import sys
input = sys.stdin.readline
(h, w, n) = map(int, input().split())
ans = [(h - 2) * (w - 2)] + [0] * 9
s1 = set()
s2 = set()
for i in range(n):
	(a, b) = map(int, input().split())
	s2.add(a * 10 ** 10 + b)
	for j in range(3):
		for k in range(3):
			if 0 < a - j < h - 1 and 0 < b - k < w - 1:
				s1.add((a - j) * 10 ** 10 + b - k)
for x in s1:
	now = 0
	for i in range(3):
		for j in range(3):
			if x + i * 10 ** 10 + j in s2:
				now += 1
	ans[now] += 1
ans[0] -= sum(ans[1:])
[print(x) for x in ans]


(h, w, n) = map(int, input().split())
d = dict()

def change(a, b):
	global h, w, d
	if 1 <= a < h - 1 and 1 <= b < w - 1:
		if (a, b) in d:
			d[a, b] += 1
		else:
			d[a, b] = 1
for i in range(n):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	change(a, b)
	change(a - 1, b - 1)
	change(a - 1, b + 1)
	change(a + 1, b - 1)
	change(a + 1, b + 1)
	change(a - 1, b)
	change(a + 1, b)
	change(a, b - 1)
	change(a, b + 1)
ans = [0] * 10
ans[0] = (h - 2) * (w - 2)
for i in d:
	ans[d[i]] += 1
	ans[0] -= 1
for i in range(10):
	print(ans[i])


from collections import defaultdict
(H, W, N) = map(int, input().split())
d = defaultdict(int)
for n in range(N):
	(y, x) = map(int, input().split())
	for i in range(3):
		for j in range(3):
			if W - 3 >= x + i - 3 >= 0 and H - 3 >= y + j - 3 >= 0:
				d[x + i - 3, y + j - 3] += 1
ans = [0] * 10
S = 0
for (t, t_num) in d.items():
	ans[t_num] += 1
	S += 1
ans[0] = (H - 2) * (W - 2) - S
for i in range(10):
	print(ans[i])


(H, W, N, *L) = 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 dic.keys():
	ans[dic[k]] += 1
	ans[0] -= 1
print('\n'.join(map(str, ans)))


import sys
from collections import defaultdict

def solve():
	input = sys.stdin.readline
	(H, W, N) = map(int, input().split())
	C = defaultdict(int)
	for _ in range(N):
		(a, b) = map(int, input().split())
		a -= 1
		b -= 1
		for h in range(3):
			for w in range(3):
				if 0 <= a - h < H - 2 and 0 <= b - w < W - 2:
					C[a - h, b - w] += 1
	ans = [0] * 10
	s = 0
	for key in C:
		ans[C[key]] += 1
		s += 1
	ans[0] = (H - 2) * (W - 2) - s
	print(*ans, sep='\n')
	return 0

def __starting_point():
	solve()
__starting_point()


(h, w, n) = map(int, input().split())
ab = [tuple(map(int, input().split())) for i in range(n)]
J = [0] * 10
black = dict()
for i in ab:
	black[i] = 1
for (a, b) in ab:
	for x in range(max(0, 3 - a), min(3, h + 1 - a)):
		for y in range(max(0, 3 - b), min(3, w + 1 - b)):
			j = 0
			for X in range(a + x - 2, a + x + 1):
				for Y in range(b + y - 2, b + y + 1):
					if (X, Y) in black:
						j += 1
			J[j] += 1
for i in range(2, 10):
	J[i] //= i
ALL = (h - 2) * (w - 2)
J[0] = ALL - sum(J[1:])
for i in J:
	print(i)


from collections import defaultdict
(H, W, N) = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
Cells = defaultdict(int)
Count = [(H - 2) * (W - 2)] + [0 for _ in range(9)]
for (a, b) in AB:
	a -= 1
	b -= 1
	for i in range(-1, 2):
		for j in range(-1, 2):
			if 1 <= a + i <= H - 2 and 1 <= b + j <= W - 2:
				Count[Cells[a + i, b + j]] -= 1
				Count[Cells[a + i, b + j] + 1] += 1
			Cells[a + i, b + j] += 1
for c in Count:
	print(c)


from collections import defaultdict, Counter
(h, w, n) = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
d = defaultdict(int)
for (a, b) in ab:
	for hi in range(a - 2, a + 1):
		for wi in range(b - 2, b + 1):
			if 1 <= hi <= h - 2 and 1 <= wi <= w - 2:
				d[hi, wi] += 1
c = Counter(d.values())
print((h - 2) * (w - 2) - sum(c.values()))
for i in range(1, 10):
	print(c[i])


(h, w, n) = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
from collections import defaultdict
dct = defaultdict(int)
ans = {i: 0 for i in range(10)}
ans[0] = (h - 2) * (w - 2)
for (a, b) in ab:
	a -= 1
	b -= 1
	u = max(0, a - 2)
	d = min(h - 3, a)
	l = max(0, b - 2)
	r = min(w - 3, b)
	for i in range(u, d + 1):
		for j in range(l, r + 1):
			ans[dct[i, j]] -= 1
			dct[i, j] += 1
			ans[dct[i, j]] += 1
for i in range(10):
	print(ans[i])


(H, W, N) = list(map(int, input().split()))
ans = {}
for i in range(N):
	(a, b) = list(map(int, input().split()))
	for j in range(-1, 2):
		for k in range(-1, 2):
			if a + j >= 2 and b + k >= 2 and (a + j <= H - 1) and (b + k <= W - 1):
				key = str(a + j) + '_' + str(b + k)
				ans[key] = ans.get(key, 0) + 1
ans_value = list(ans.values())
ans_n0 = 0
for i in range(1, 10):
	ans_n0 = ans_n0 + ans_value.count(i)
print((H - 2) * (W - 2) - ans_n0)
for i in range(1, 10):
	print(ans_value.count(i))


from collections import defaultdict
(h, w, n) = list(map(int, input().split()))
ans = [0 for i in range(10)]
board = defaultdict(int)
for i in range(n):
	(a, b) = list(map(int, input().split()))
	a = a - 1
	b = b - 1
	for dx in range(b - 1, b + 2):
		if dx <= 0 or dx >= w - 1:
			continue
		for dy in range(a - 1, a + 2):
			if dy <= 0 or dy >= h - 1:
				continue
			board[dx, dy] += 1
for v in board.values():
	ans[v] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for i in range(10):
	print(ans[i])


(H, W, N) = map(int, input().split())
count = []
L = 0
for i in range(N):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for i in range(max(0, a - 2), min(a + 1, H - 2)):
		for j in range(max(0, b - 2), min(b + 1, W - 2)):
			count.append((i, j))
			L += 1
count.sort()
ans = [0] * 10
tmp = 1
for i in range(L - 1):
	if count[i] == count[i + 1]:
		tmp += 1
	else:
		ans[tmp] += 1
		tmp = 1
if L >= 1:
	ans[tmp] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
for i in range(10):
	print(ans[i])


(H, W, N) = [int(v) for v in input().split()]
points = (list(map(int, input().split())) for _ in range(N))
memory = {}
for (ai, bi) in points:
	for i in range(max(2, ai - 1), min(H - 1, ai + 1) + 1):
		for j in range(max(2, bi - 1), min(W - 1, bi + 1) + 1):
			key = (i, j)
			if not key in memory:
				memory[key] = 0
			memory[key] += 1
counter = {i: 0 for i in range(1, 10)}
for v in list(memory.values()):
	counter[v] += 1
print((H - 2) * (W - 2) - sum(counter.values()))
for i in range(1, 10):
	print(counter[i])


from collections import defaultdict

def solve():
	(H, W, N) = map(int, input().split())
	ans = [0] * 10
	dic = defaultdict(lambda : defaultdict(lambda : 0))
	for i in range(N):
		(x, y) = map(int, input().split())
		x -= 1
		y -= 1
		for i in range(x - 1, x + 2):
			for j in range(y - 1, y + 2):
				if i > 0 and i < H - 1 and (j > 0) and (j < W - 1):
					if dic[i][j] > 0:
						ans[dic[i][j]] -= 1
					dic[i][j] += 1
					ans[dic[i][j]] += 1
	total = (H - 2) * (W - 2)
	ans[0] = total - sum(ans[1:])
	return ans
print(*solve(), sep='\n')


from collections import defaultdict as de
from collections import Counter as C
(h, w, n) = map(int, input().split())
s = [0] * 10
c = de(int)
for i in range(n):
	(a, b) = map(int, input().split())
	for j in range(max(2, a - 1), min(a + 2, h)):
		for q in range(max(2, b - 1), min(b + 2, w)):
			c[j, q] += 1
a = C(c.values())
print((h - 2) * (w - 2) - sum(a.values()))
for i in range(1, 10):
	print(a[i])


(h, w, n) = list(map(int, input().split()))
idx1 = 0
ab = [[0 for i in range(2)] for j in range(n)]
black_cnt = [0] * 10
black_cnt[0] = (h - 2) * (w - 2)
if n != 0:
	while idx1 < n:
		x = input().split()
		ab[idx1] = [int(x[0]), int(x[1])]
		idx1 += 1
	myDict = {}
	for abitem in ab:
		if abitem[0] < 3:
			sr = 0
		else:
			sr = abitem[0] - 3
		if abitem[0] > h - 3:
			lr = h - 2
		else:
			lr = abitem[0]
		if abitem[1] < 3:
			sc = 0
		else:
			sc = abitem[1] - 3
		if abitem[1] > w - 3:
			lc = w - 2
		else:
			lc = abitem[1]
		for nowRow in range(sr, lr):
			for nowCol in range(sc, lc):
				key = str(nowRow) + ',' + str(nowCol)
				if key in myDict:
					myDict[key] += 1
				else:
					myDict[key] = 1
	for bcnt in list(myDict.values()):
		black_cnt[bcnt] += 1
		black_cnt[0] -= 1
for item in black_cnt:
	print(item)


import sys
input = sys.stdin.readline
(H, W, N) = map(int, input().split())
A = []
for i in range(N):
	(a, b) = map(int, input().split())
	for i in [-1, 0, 1]:
		for j in [-1, 0, 1]:
			if 1 < a + i < H and 1 < b + j < W:
				A.append([a + i, b + j])
A.sort()
ans = [0] * 10
hoge = 0
for i in range(len(A)):
	if A[i] == A[i - 1]:
		hoge += 1
	else:
		ans[hoge] += 1
		hoge = 1
ans[hoge] += 1
ans[0] = (W - 2) * (H - 2) - sum(ans[1:])
for i in ans:
	print(i)


from collections import defaultdict as ddict
d = (-1, 0, 1)
cmap = ddict(int)
(h, w, n) = map(int, input().split())
for _ in range(n):
	(a, b) = map(int, input().split())
	for x in d:
		for y in d:
			ca = a + x
			cb = b + y
			if 1 < ca < h and 1 < cb < w:
				cmap[ca, cb] += 1
l = [0] * 10
j = list(cmap.values())
for i in range(1, 10):
	l[i] = j.count(i)
l[0] = (h - 2) * (w - 2) - sum(l)
for x in l:
	print(x)


def main():
	import sys
	input = sys.stdin.readline
	(h, w, n) = map(int, input().split())
	ans = [0] * 10
	p = set()
	q = set()
	for i in range(n):
		(a, b) = map(int, input().split())
		for j in range(-1, 2):
			for k in range(-1, 2):
				if 2 <= a + j <= h - 1 and 2 <= b + k <= w - 1:
					r = (a + j) * 10 ** 10 + b + k
					p.add(r)
		q.add(a * 10 ** 10 + b)
	p = list(p)
	for x in p:
		cnt = 0
		for j in range(-1, 2):
			for k in range(-1, 2):
				if x + j * 10 ** 10 + k in q:
					cnt += 1
		ans[cnt] += 1
	print((h - 2) * (w - 2) - sum(ans[1:]))
	for i in range(1, 10):
		print(ans[i])
main()


from collections import defaultdict
(H, W, N) = map(int, input().split())
P = [0] * 10
P[0] = (H - 2) * (W - 2)
G = defaultdict(lambda : defaultdict(int))
for i in range(N):
	(a, b) = map(int, input().split())
	for i in range(max(a - 3, 0), min(a, H - 2)):
		for j in range(max(b - 3, 0), min(b, W - 2)):
			p = G[i][j]
			P[p] -= 1
			P[p + 1] += 1
			G[i][j] += 1
for i in range(10):
	print(P[i])


import sys
input = sys.stdin.readline
MOD = 10 ** 9 + 7
from collections import defaultdict
(H, W, N) = map(int, input().split())
dic = defaultdict(int)
lst = [0] * 10
lst[0] = (H - 2) * (W - 2)
for _ in range(N):
	(a, b) = map(int, input().split())
	for i in range(-1, 2):
		for j in range(-1, 2):
			if 2 <= a + i <= H - 1:
				if 2 <= b + j <= W - 1:
					tmp = dic[a + i, b + j]
					lst[tmp] -= 1
					lst[tmp + 1] += 1
					dic[a + i, b + j] += 1
print(*lst, sep='\n')


from collections import defaultdict
(H, W, N) = map(int, input().split())
ans = [(H - 2) * (W - 2)] + [0] * 9
blacks = defaultdict(int)
for i in range(N):
	(a, b) = map(int, input().split())
	for dx in [-1, 0, 1]:
		for dy in [-1, 0, 1]:
			if 2 <= a + dx < H and 2 <= b + dy < W:
				ans[blacks[a + dx, b + dy]] -= 1
				ans[blacks[a + dx, b + dy] + 1] += 1
			blacks[a + dx, b + dy] += 1
for i in range(10):
	print(ans[i])


from collections import defaultdict
(H, W, N) = map(int, input().split())
d = defaultdict(int)
ta = [1, 1, 0, -1, -1, -1, 0, 1, 0]
tb = [0, 1, 1, 1, 0, -1, -1, -1, 0]
for _ in range(N):
	(a, b) = map(int, input().split())
	for i in range(9):
		na = a + ta[i]
		nb = b + tb[i]
		if 1 <= na <= H and 1 <= nb <= W:
			d[na, nb] += 1
ans = [0] * 10
for (i, v) in d.items():
	if 2 <= i[0] <= H - 1 and 2 <= i[1] <= W - 1:
		ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
for i in range(10):
	print(ans[i])


import collections as cl
(h, w, n) = map(int, input().split())
l = []
for i in range(n):
	(a, b) = map(int, input().split())
	for i in range(3):
		x = a + (i - 1)
		if x in [0, 1, h, h + 1]:
			continue
		for j in range(3):
			y = b + (j - 1)
			if y in [0, 1, w, w + 1]:
				continue
			l.append((x - 1) * w + y)
p = cl.Counter(l)
q = cl.Counter(p.values())
print((h - 2) * (w - 2) - sum(q.values()))
for i in range(1, 10):
	if i in q.keys():
		print(q[i])
	else:
		print(0)


dx = [-1, -1, -1, 0, 0, 1, 1, 1, 0]
dy = [-1, 0, 1, -1, 1, -1, 0, 1, 0]
(H, W, N) = map(int, input().split())
from collections import defaultdict, Counter
d = defaultdict(int)
for i in range(N):
	(a, b) = map(int, input().split())
	for j in range(9):
		A = a + dy[j]
		B = b + dx[j]
		f = 0
		if 2 <= A <= H - 1:
			if 2 <= B <= W - 1:
				f = 1
		if f == 1:
			d[A, B] += 1
s = 0
c = Counter(d.values())
for i in range(1, 10):
	s += c[i]
c[0] = (H - 2) * (W - 2) - s
for i in range(10):
	print(c[i])


import sys
readline = sys.stdin.readline
(H, W, N) = map(int, readline().split())
from collections import defaultdict
dic = defaultdict(int)
for i in range(N):
	(a, b) = map(int, readline().split())
	(a, b) = (a - 1, b - 1)
	for A in range(max(0, a - 2), min(a + 1, H - 2)):
		if A < 0:
			continue
		for B in range(max(0, b - 2), min(b + 1, W - 2)):
			if B < 0:
				continue
			dic[A, B] += 1
ans = [0] * 10
for v in dic.values():
	ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])
for a in ans:
	print(a)


from collections import Counter
(H, W, N, *AB) = 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 C.values():
	D[v] += 1
print((H - 2) * (W - 2) - len(C))
for i in range(1, 10):
	print(D[i])


import sys
input = sys.stdin.readline

def main():
	(h, w, n) = map(int, input().split())
	dg = 10 ** 10
	d = dict()

	def f(z):
		(x, y) = divmod(z, dg)
		if 2 <= x <= h - 1 and 2 <= y <= w - 1:
			return True
		else:
			False
	for i in range(n):
		(a, b) = map(int, input().split())
		if f((a - 1) * dg + b - 1):
			if (a - 1) * dg + b - 1 in d:
				d[(a - 1) * dg + b - 1] += 1
			else:
				d[(a - 1) * dg + b - 1] = 1
		if f((a - 1) * dg + b):
			if (a - 1) * dg + b in d:
				d[(a - 1) * dg + b] += 1
			else:
				d[(a - 1) * dg + b] = 1
		if f((a - 1) * dg + b + 1):
			if (a - 1) * dg + b + 1 in d:
				d[(a - 1) * dg + b + 1] += 1
			else:
				d[(a - 1) * dg + b + 1] = 1
		if f(a * dg + b - 1):
			if a * dg + b - 1 in d:
				d[a * dg + b - 1] += 1
			else:
				d[a * dg + b - 1] = 1
		if f(a * dg + b):
			if a * dg + b in d:
				d[a * dg + b] += 1
			else:
				d[a * dg + b] = 1
		if f(a * dg + b + 1):
			if a * dg + b + 1 in d:
				d[a * dg + b + 1] += 1
			else:
				d[a * dg + b + 1] = 1
		if f((a + 1) * dg + b + 1):
			if (a + 1) * dg + b + 1 in d:
				d[(a + 1) * dg + b + 1] += 1
			else:
				d[(a + 1) * dg + b + 1] = 1
		if f((a + 1) * dg + b):
			if (a + 1) * dg + b in d:
				d[(a + 1) * dg + b] += 1
			else:
				d[(a + 1) * dg + b] = 1
		if f((a + 1) * dg + b - 1):
			if (a + 1) * dg + b - 1 in d:
				d[(a + 1) * dg + b - 1] += 1
			else:
				d[(a + 1) * dg + b - 1] = 1
	res = [0] * 10
	for e in d:
		res[d[e]] += 1
	res[0] = (h - 2) * (w - 2) - sum(res)
	for e in res:
		print(e)

def __starting_point():
	main()
__starting_point()


from collections import defaultdict
Delta = [-1, 0, 1]
d = defaultdict(lambda : 0)

def paint(d, x, y):
	for dx in Delta:
		for dy in Delta:
			d[x + dx, y + dy] += 1
(H, W, N) = map(int, input().split())
for i in range(N):
	(a, b) = map(int, input().split())
	paint(d, a, b)
ans = defaultdict(lambda : 0)
for (x, y) in d.keys():
	if 2 <= x <= H - 1 and 2 <= y <= W - 1:
		ans[d[x, y]] += 1
ans0 = (H - 2) * (W - 2)
for i in range(10):
	ans0 -= ans[i]
ans[0] = ans0
for i in range(10):
	print(ans[i])


(H, W, N) = map(int, input().split())
ab = [list(map(int, input().split())) for _ in [0] * N]
d = {}
for (a, b) in ab:
	for da in (-1, 0, 1):
		for db in (-1, 0, 1):
			if not (2 <= a + da <= H - 1 and 2 <= b + db <= W - 1):
				continue
			d[a + da, b + db] = d.get((a + da, b + db), 0) + 1
ans = [0] * 10
for v in d.values():
	ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])
print(*ans, sep='\n')


(H, W, N) = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(N)]
from collections import defaultdict
from collections import Counter
ANS = defaultdict(int)
for (a, b) in AB:
	for i in [a - 1, a, a + 1]:
		for j in [b - 1, b, b + 1]:
			if 2 <= i < H and 2 <= j < W:
				ANS[i, j] += 1
counter = Counter(ANS.values())
ANSLIST = [0] * 10
for c in counter:
	ANSLIST[c] = counter[c]
ANSLIST[0] = (H - 2) * (W - 2) - sum(counter.values())
for a in ANSLIST:
	print(a)


(H, W, N) = map(int, input().split())
d = {}
for i in range(N):
	(a, b) = map(int, input().split())
	(a, b) = (a - 1, b - 1)
	for j in range(-1, 2):
		for k in range(-1, 2):
			if 1 <= a + j < H - 1 and 1 <= b + k < W - 1:
				if d.get((a + j, b + k)) is None:
					d[a + j, b + k] = 0
				d[a + j, b + k] += 1
ans = [0] * 10
for v in d.values():
	ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])
for i in range(10):
	print(ans[i])


from collections import *
(h, w, n) = map(int, input().split())
d = defaultdict(int)
for x in [0] * n:
	(a, b) = map(int, input().split())
	for i in [a - 1, a, a + 1]:
		for j in [b - 1, b, b + 1]:
			d[i, j] += 1
c = [0] * 10
c[0] = (w - 2) * (h - 2)
for i in d:
	(a, b) = i
	if 1 < a < h and 1 < b < w:
		c[d[i]] += 1
		c[0] -= 1
for i in c:
	print(i)


(h, w, n) = map(int, input().split())
d = dict()
ans = [0] * 10
for _ in range(n):
	(a, b) = map(int, input().split())
	for i in range(-1, 2):
		for j in range(-1, 2):
			(x, y) = (a + i, b + j)
			if 1 < x < h and 1 < y < w:
				k = x * w + y
				if not k in d:
					d[k] = 1
					ans[1] += 1
				else:
					ans[d[k]] -= 1
					ans[d[k] + 1] += 1
					d[k] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for i in ans:
	print(i)


from collections import Counter
import sys
import itertools
input = sys.stdin.readline
c = Counter()
(H, W, N) = map(int, input().split())
for _ in range(N):
	(a, b) = map(int, input().split())
	for (dx, dy) in itertools.product([-1, 0, 1], repeat=2):
		aa = a + dx
		bb = b + dy
		if 2 <= aa <= H - 1 and 2 <= bb <= W - 1:
			c[aa, bb] += 1
result = Counter(c.values())
result[0] = (H - 2) * (W - 2) - sum(result.values())
for j in range(10):
	print(result[j])


a = {}
(h, w, n) = map(int, input().split())
for i in range(n):
	(y, x) = map(int, input().split())
	for j in range(max(2, x - 1), min(w - 1, x + 1) + 1):
		for k in range(max(2, y - 1), min(h - 1, y + 1) + 1):
			if j * 10 ** 10 + k in a:
				a[j * 10 ** 10 + k] += 1
			else:
				a[j * 10 ** 10 + k] = 1
ans = [0] * 10
ans[0] = (h - 2) * (w - 2)
for key in a:
	ans[0] -= 1
	ans[a[key]] += 1
for i in ans:
	print(i)


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
			elif (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')

def __starting_point():
	resolve()
__starting_point()


import collections
(h, w, n) = map(int, input().split(' '))
list_include = []
for i in range(n):
	(a, b) = map(int, input().split(' '))
	for y in range(3):
		for x in range(3):
			if a - y > 0 and a - y + 2 <= h:
				if b - x > 0 and b - x + 2 <= w:
					list_include.append((a - y, b - x))
count = collections.Counter(list_include)
result = [0 for _ in range(10)]
for item in count.items():
	result[item[1]] += 1
result[0] = (h - 2) * (w - 2) - sum(result)
for one_result in result:
	print(one_result)


from collections import defaultdict, Counter
(H, W, N) = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]
ctr = defaultdict(int)
for (a, b) in X:
	for k in range(3):
		for l in range(3):
			if 1 <= a - k <= H - 2 and 1 <= b - l <= W - 2:
				ctr[a - k, b - l] += 1
d = Counter(ctr.values())
for i in range(10):
	if i == 0:
		print((H - 2) * (W - 2) - sum(d.values()))
	else:
		print(d[i])


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
from collections import defaultdict
(H, W, N) = list(map(int, input().split()))
dic = defaultdict(int)
dx = [-1, 0, 1, -1, 0, 1, -1, 0, 1]
dy = [1, 1, 1, 0, 0, 0, -1, -1, -1]
for i in range(N):
	(y, x) = list(map(int, input().split()))
	for j in range(9):
		(ny, nx) = (y + dy[j], x + dx[j])
		if not 1 < ny < H:
			continue
		if not 1 < nx < W:
			continue
		dic[str(ny) + ':' + str(nx)] += 1
count = [0] * 10
tot = (H - 3 + 1) * (W - 3 + 1)
count[0] = tot - len(list(dic.keys()))
for (k, v) in list(dic.items()):
	count[v] += 1
for c in count:
	print(c)


import sys
import math
from collections import deque
from collections import Counter
sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda : sys.stdin.readline().strip()
NI = lambda : int(input())
NMI = lambda : map(int, input().split())
NLI = lambda : list(NMI())
SI = lambda : input()

def main():
	(H, W, N) = NMI()
	grid = {}
	for i in range(N):
		(a, b) = NMI()
		for t in range(-2, 1):
			for k in range(-2, 1):
				if a + t < 1 or b + k < 1:
					continue
				if a + t >= H - 1 or b + k >= W - 1:
					continue
				point = (a + t) * 10 ** 10 + b + k
				grid[point] = grid.get(point, 0) + 1
	c = Counter(grid.values())
	for i in range(10):
		if i == 0:
			print((H - 2) * (W - 2) - sum(c.values()))
		else:
			print(c.get(i, 0))

def __starting_point():
	main()
__starting_point()


from collections import defaultdict
(h, w, n) = map(int, input().split())
d = defaultdict(int)
s = set()
for _ in range(n):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for dy in [-2, -1, 0]:
		for dx in [-2, -1, 0]:
			(ny, nx) = (a + dy, b + dx)
			if 0 <= ny < h and 0 <= nx < w and (ny + 2 < h) and (nx + 2 < w):
				d[ny, nx] += 1
				s.add((ny, nx))
cnt = [0] * 10
q = 0
for (y, x) in s:
	cnt[d[y, x]] += 1
cnt[0] = (h - 2) * (w - 2) - len(s)
for i in cnt:
	print(i)


from collections import defaultdict
import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def MI1():
	return map(int1, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]
(h, w, n) = MI()
sq = defaultdict(int)
for _ in range(n):
	(a, b) = MI1()
	for i in range(max(0, a - 2), min(h - 2, a + 1)):
		for j in range(max(0, b - 2), min(w - 2, b + 1)):
			sq[i, j] += 1
cnt = [0] * 10
for (k, v) in sq.items():
	cnt[v] += 1
cnt[0] = (h - 2) * (w - 2) - sum(cnt)
print(*cnt, sep='\n')


from collections import Counter
(H, W, N) = list(map(int, input().split()))
dir = [[0, 0], [1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
dict = {}
for i in range(N):
	(a, b) = list(map(int, input().split()))
	for (dy, dx) in dir:
		if 2 <= a + dy <= H - 1 and 2 <= b + dx <= W - 1:
			if (a + dy, b + dx) not in dict:
				dict[a + dy, b + dx] = 1
			else:
				dict[a + dy, b + dx] += 1
c = Counter(list(dict.values()))
ans = [0 for _ in range(10)]
for (k, v) in list(c.items()):
	if v > 0:
		ans[k] = v
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])
for i in range(10):
	print(ans[i])


(H, W, N) = map(int, input().split())
AB = dict()
for i in range(N):
	(a, b) = list(map(int, input().split()))
	for i in range(3):
		for j in range(3):
			x = a - 1 - i
			y = b - 1 - j
			if 0 <= x < H - 2 and 0 <= y < W - 2:
				ab = str(x) + 'ab' + str(y)
				if ab in AB:
					AB[ab] += 1
				else:
					AB[ab] = 1
ans = [0] * 10
for i in AB.values():
	ans[i] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
for i in range(10):
	print(ans[i])


(h, w, n) = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
from collections import defaultdict
d = defaultdict(int)
for tmp in l:
	y = tmp[0] - 1
	x = tmp[1] - 1
	for i in [-1, 0, 1]:
		for j in [-1, 0, 1]:
			if 1 <= x + i < w - 1 and 1 <= y + j < h - 1:
				s = str(x + i) + '_' + str(y + j)
				d[s] += 1
import collections
lis = list(d.values())
c = collections.Counter(lis)
ans = [0] * 10
for itm in c.items():
	ans[itm[0]] = itm[1]
ans[0] = (h - 2) * (w - 2) - sum(ans)
for a in ans:
	print(a)


from collections import defaultdict
(H, W, N) = map(int, input().split())
allcase = (H - 2) * (W - 2)
abset = set()
for _ in range(N):
	(a, b) = map(int, input().split())
	abset.add((a - 1, b - 1))
memo = defaultdict(int)
for (a, b) in abset:
	for j in range(-2, 1):
		if a + j < 0 or H - 2 <= a + j:
			continue
		for k in range(-2, 1):
			if b + k < 0 or W - 2 <= b + k:
				continue
			memo[a + j, b + k] += 1
case_list = [0] * 10
for v in memo.values():
	case_list[v] += 1
case_list[0] = allcase - sum(case_list[1:])
for i in range(10):
	print(case_list[i])


(H, W, N) = map(int, input().split())
from collections import defaultdict
L = defaultdict(int)
for i in range(N):
	(a, b) = 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 L.values():
	ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
for i in range(10):
	print(ans[i])


import collections
(H, W, N) = map(int, input().split())
table = collections.defaultdict(int)
for i in range(N):
	(a, b) = map(int, input().split())
	for yy in range(3):
		for xx in range(3):
			y = a - 1 - yy
			x = b - 1 - xx
			if 0 <= y and y + 2 < H and (0 <= x) and (x + 2 < W):
				table[y, x] += 1
counts = [0] * 10
for v in table.values():
	counts[v] += 1
counts[0] = (H - 2) * (W - 2) - sum(counts)
for c in counts:
	print(c)


import sys

def MI():
	return map(int, sys.stdin.readline().rstrip().split())
(H, W, N) = MI()
from collections import defaultdict, Counter
d = defaultdict(int)
for i in range(N):
	(a, b) = MI()
	for j in range(max(1, a - 2), min(a, H - 2) + 1):
		for k in range(max(1, b - 2), min(b, W - 2) + 1):
			d[j, k] += 1
c = Counter(list(d.values()))
print((H - 2) * (W - 2) - sum(c.values()))
for i in range(1, 10):
	print(c[i])


from collections import Counter
(h, w, n) = [int(i) for i in input().split()]
vs = []
for i in range(-1, 2):
	for j in range(-1, 2):
		vs.append((i, j))
cnt = []
for _ in range(n):
	(a, b) = [int(i) for i in input().split()]
	for v in vs:
		aa = a + v[0]
		bb = b + v[1]
		if 2 <= aa <= h - 1 and 2 <= bb <= w - 1:
			cnt.append(aa * w + bb)
cnt = Counter(cnt)
cnt2 = [0] * 10
cnt2[0] = (h - 2) * (w - 2)
for k in cnt:
	c = cnt[k]
	cnt2[c] += 1
	cnt2[0] -= 1
for i in cnt2:
	print(i)


import sys
input = sys.stdin.readline
(h, w, n) = map(int, input().split())
z = (h - 2) * (w - 2)
p = []
for i in range(n):
	(x, y) = map(int, input().split())
	for j in range(3):
		for k in range(3):
			p.append([x + j - 1, y + k - 1])
p.sort(key=lambda x: 10 ** 10 * x[0] + x[1])
n = len(p)
p.append([10 ** 20, 10 ** 20])
ans = [0] * 10
f = 1
for i in range(n):
	if 2 <= p[i][0] <= h - 1 and 2 <= p[i][1] <= w - 1:
		if p[i] == p[i + 1]:
			f += 1
		else:
			ans[f] += 1
			f = 1
ans[0] = z - sum(ans)
for i in ans:
	print(i)


from itertools import product
from collections import Counter
(H, W, N) = map(int, input().split())
V = set([tuple(map(int, input().split())) for _ in range(N)])
D = tuple(product((-1, 0, 1), repeat=2))
A = set()
cnt = Counter()
for (a, b) in V:
	for (h, w) in D:
		if 2 <= a + h <= H - 1 and 2 <= b + w <= W - 1:
			cnt[a + h, b + w] += 1
ans = [0] * 10
for c in cnt.values():
	ans[c] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
print(*ans, sep='\n')


from collections import Counter, defaultdict
(h, w, n) = map(int, input().split())
(hs, ws) = (h - 2, w - 2)
dd = defaultdict(int)
for (a, b) in (map(int, input().split()) for _ in range(n)):
	for y in range(max(0, a - 3), min(a, hs)):
		for x in range(max(0, b - 3), min(b, ws)):
			dd[y, x] += 1
print(hs * ws - len(dd))
c = Counter(dd.values())
for i in range(1, 10):
	print(c[i] if i in c else 0)


from collections import defaultdict
(H, W, N) = map(int, input().split())
mem = defaultdict(int)
for _ in range(N):
	(a, b) = map(int, input().split())
	for i in range(max(1, a - 1), min(H, a + 1) + 1):
		for j in range(max(1, b - 1), min(W, b + 1) + 1):
			mem[i, j] += 1
ret = [0] * 10
for (k, v) in mem.items():
	if 2 <= k[0] <= H - 1 and 2 <= k[1] <= W - 1:
		ret[v] += 1
ret[0] = (H - 2) * (W - 2) - sum(ret)
for r in ret:
	print(r)


def main():
	(H, W, N) = map(int, input().split())
	C = {}
	for _ in range(N):
		(a, b) = map(int, input().split())
		for x in range(max(2, a - 1), min(H, a + 2)):
			for y in range(max(2, b - 1), min(W, b + 2)):
				C[x, y] = C.get((x, y), 0) + 1
	D = list(C.values())
	print((H - 2) * (W - 2) - len(C))
	for j in range(1, 10):
		print(D.count(j))
main()


(h, w, n) = [int(i) for i in input().split()]
A = [0 for _ in range(n)]
B = [0 for _ in range(n)]
cnt = {}
for i in range(n):
	(a, b) = [int(j) for j in input().split()]
	if a > 1 and b > 1 and (a < h) and (b < w):
		if '{} {}'.format(a, b) not in list(cnt.keys()):
			cnt['{} {}'.format(a, b)] = 0
		cnt['{} {}'.format(a, b)] += 1
	if a > 2 and b > 2 and (a <= h) and (b <= w):
		if '{} {}'.format(a - 1, b - 1) not in list(cnt.keys()):
			cnt['{} {}'.format(a - 1, b - 1)] = 0
		cnt['{} {}'.format(a - 1, b - 1)] += 1
	if a > 2 and b > 1 and (a <= h) and (b < w):
		if '{} {}'.format(a - 1, b) not in list(cnt.keys()):
			cnt['{} {}'.format(a - 1, b)] = 0
		cnt['{} {}'.format(a - 1, b)] += 1
	if a > 2 and b > 0 and (a <= h) and (b < w - 1):
		if '{} {}'.format(a - 1, b + 1) not in list(cnt.keys()):
			cnt['{} {}'.format(a - 1, b + 1)] = 0
		cnt['{} {}'.format(a - 1, b + 1)] += 1
	if a > 1 and b > 2 and (a < h) and (b <= w):
		if '{} {}'.format(a, b - 1) not in list(cnt.keys()):
			cnt['{} {}'.format(a, b - 1)] = 0
		cnt['{} {}'.format(a, b - 1)] += 1
	if a > 0 and b > 0 and (a < h - 1) and (b < w - 1):
		if '{} {}'.format(a + 1, b + 1) not in list(cnt.keys()):
			cnt['{} {}'.format(a + 1, b + 1)] = 0
		cnt['{} {}'.format(a + 1, b + 1)] += 1
	if a > 0 and b > 1 and (a < h - 1) and (b < w):
		if '{} {}'.format(a + 1, b) not in list(cnt.keys()):
			cnt['{} {}'.format(a + 1, b)] = 0
		cnt['{} {}'.format(a + 1, b)] += 1
	if a > 1 and b > 0 and (a < h) and (b < w - 1):
		if '{} {}'.format(a, b + 1) not in list(cnt.keys()):
			cnt['{} {}'.format(a, b + 1)] = 0
		cnt['{} {}'.format(a, b + 1)] += 1
	if a > 0 and b > 2 and (a < h - 1) and (b <= w):
		if '{} {}'.format(a + 1, b - 1) not in list(cnt.keys()):
			cnt['{} {}'.format(a + 1, b - 1)] = 0
		cnt['{} {}'.format(a + 1, b - 1)] += 1
count = [0 for i in range(10)]
for i in list(cnt.values()):
	count[i] += 1
count[0] = (h - 2) * (w - 2) - len(cnt)
for i in count:
	print(i)


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')


from collections import defaultdict
(h, w, n) = map(int, input().split())
d = defaultdict(int)
for i in range(n):
	(a, b) = map(int, input().split())
	for k in range(3):
		if 1 <= a - k <= h - 2:
			for l in range(3):
				if 1 <= b - l <= w - 2:
					x = (a - k, b - l)
					d[x] += 1
ans = [0] * 10
for v in d.values():
	ans[v] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans[1:])
for i in range(10):
	print(ans[i])


from collections import Counter, defaultdict
(h, w, n) = map(int, input().split())
ab = [[int(i) - 1 for i in input().split()] for j in range(n)]
d = defaultdict(int)
for i in range(n):
	for j in range(3):
		for k in range(3):
			if ab[i][0] - j >= 0 and ab[i][1] - k >= 0 and (ab[i][0] - j < h - 2) and (ab[i][1] - k < w - 2):
				d[ab[i][0] - j, ab[i][1] - k] += 1
print((h - 2) * (w - 2) - len(d))
c = Counter(d.values())
for i in range(1, 10):
	print(c[i] if i in c else 0)


from collections import Counter
(H, W, N) = map(int, input().split())
src = [tuple(map(int, input().split())) for i in range(N)]
blacks = Counter()
for (y, x) in src:
	for i in range(-1, 2):
		if not 0 <= y + i < H:
			continue
		for j in range(-1, 2):
			if not 0 <= x + j < W:
				continue
			blacks[x + j, y + i] += 1
ans = [0] * 10
for ((x, y), v) in blacks.items():
	if x < 2 or y < 2:
		continue
	ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])
print(*ans, sep='\n')


from collections import defaultdict
(H, W, N) = [int(n) for n in input().split()]
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)


(h, w, n) = map(int, input().split())
square = dict()
for i in range(n):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for x in range(b - 2, b + 1, 1):
		for y in range(a - 2, a + 1, 1):
			if 0 <= y <= h - 3 and 0 <= x <= w - 3:
				if (x, y) in square:
					square[x, y] += 1
				else:
					square[x, y] = 1
ans = [0 for i in range(10)]
for i in square.values():
	ans[i] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for i in range(10):
	print(ans[i])


(h, w, n) = [int(_) for _ in input().split(' ')]
d = {}
for _ in range(n):
	(a, b) = [int(_) for _ in input().split(' ')]
	for i in [-1, 0, 1]:
		for j in [-1, 0, 1]:
			k = (a + i, b + j)
			if k in d:
				d[k] += 1
			else:
				d[k] = 1
ans = {i: 0 for i in range(1, 10)}
s = 0
for (k, v) in d.items():
	if 1 < k[0] < h and 1 < k[1] < w:
		ans[v] += 1
		s += 1
ans[0] = (w - 2) * (h - 2) - s
for _ in range(10):
	print(ans[_])


def add_memo(tate, yoko):
	nonlocal memo
	if 2 <= tate <= h - 1:
		if 2 <= yoko <= w - 1:
			memo.append([tate, yoko])
(h, w, n) = list(map(int, input().split()))
memo = []
for i in range(0, n):
	(x, y) = list(map(int, input().split()))
	add_memo(x - 1, y - 1)
	add_memo(x - 1, y)
	add_memo(x - 1, y + 1)
	add_memo(x, y - 1)
	add_memo(x, y)
	add_memo(x, y + 1)
	add_memo(x + 1, y - 1)
	add_memo(x + 1, y)
	add_memo(x + 1, y + 1)
memo.sort()
ans = [0] * 10
ans[0] = (h - 2) * (w - 2)
tmp_x = 0
tmp_y = 0
count = 0
for i in range(0, len(memo)):
	if tmp_x == memo[i][0] and tmp_y == memo[i][1]:
		ans[count] -= 1
		count += 1
		ans[count] += 1
	else:
		ans[0] -= 1
		count = 1
		ans[count] += 1
	tmp_x = memo[i][0]
	tmp_y = memo[i][1]
for i in range(0, 10):
	print(ans[i])


from collections import Counter
(H, W, N, *L) = 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
c = Counter(dic.values())
ans = [(H - 2) * (W - 2)] + [0] * 9
for k in c.keys():
	ans[k] = c[k]
	ans[0] -= c[k]
print('\n'.join(map(str, ans)))


(h, w, n) = list(map(int, input().split()))
from collections import defaultdict
d = defaultdict(int)
surround = [(0, 0), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1), (-1, 0), (-1, 1), (0, 1)]
for _ in range(n):
	(x, y) = list(map(int, input().split()))
	x -= 1
	y -= 1
	for i in surround:
		if x + i[0] >= h or x + i[0] < 0 or y + i[1] < 0 or (y + i[1] >= w):
			continue
		else:
			d[x + i[0], y + i[1]] += 1
num = [0] * 10
for key in d:
	if key[0] >= 1 and key[0] < h - 1 and (key[1] >= 1) and (key[1] < w - 1):
		num[d[key]] += 1
num[0] = (h - 2) * (w - 2) - sum(num)
for ans in num:
	print(ans)


(H, W, N) = map(int, input().split())
dic = {}
for _ in range(N):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for i in range(-1, 2):
		for j in range(-1, 2):
			if a + i <= 0 or a + i >= H - 1 or b + j <= 0 or (b + j >= W - 1):
				continue
			if (a + i, b + j) in dic:
				dic[a + i, b + j] += 1
			else:
				dic[a + i, b + j] = 1
ans = [0] * 10
for t in dic.values():
	ans[t] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
for i in range(10):
	print(ans[i])


(h, w, n) = [int(i) for i in input().split()]
if n == 0:
	a = b = [0]
else:
	(a, b) = zip(*[[int(i) for i in input().split()] for j in range(n)])
board = {}
ans = [0] * 10
ans[0] = max(0, h - 2) * max(0, w - 2)
for (a, b) in zip(a, b):
	for i in range(max(2, a - 1), min(h, a + 2)):
		for j in range(max(2, b - 1), min(w, b + 2)):
			try:
				ans[board.get((i, j), 0)] -= 1
				board[i, j] = board.get((i, j), 0) + 1
				ans[board[i, j]] += 1
			except:
				pass
for i in range(10):
	print(ans[i])


from collections import defaultdict
(H, W, N) = map(int, input().split())
ab = []
dict = defaultdict(int)
for i in range(N):
	(a, b) = map(int, input().split())
	(a, b) = (a - 1, b - 1)
	for x in [-1, 0, 1]:
		for y in [-1, 0, 1]:
			Y = a + y
			X = b + x
			if 0 <= Y - 1 and Y + 1 < H and (0 <= X - 1) and (X + 1 < W):
				dict[X, Y] += 1
M = H * W - 2 * W - 2 * H + 4
v = [0] * 10
for (i, j) in dict.items():
	v[j] += 1
v[0] = M - sum(v[1:])
for i in range(10):
	print(v[i])


from collections import defaultdict
(縦, 横, _, *点) = map(int, open(0).read().split())
あー = defaultdict(int)
for (y, x) in zip(*[iter(点)] * 2):
	y -= 1
	x -= 1
	for i in range(9):
		あー[y - 1 + i // 3, x - 1 + i % 3] += 1
答 = [0] * 10
for ([y, x], c) in あー.items():
	答[c] += 横 - 1 > x > 0 < y < 縦 - 1
答[0] = (縦 - 2) * (横 - 2) - sum(答)
print(*答)


from collections import Counter
(H, W, N) = map(int, input().split())
L = []
for k in range(N):
	(a, b) = map(int, input().split())
	for k in range(3):
		for l in range(3):
			if 1 <= a - k <= H - 2 and 1 <= b - l <= W - 2:
				L.append((a - k, b - l))
M = Counter(L)
A = [0 for k in range(10)]
s = 0
for e in M:
	A[M[e]] += 1
	s += 1
A[0] = (H - 2) * (W - 2) - s
for a in A:
	print(a)


(h, w, n) = map(int, input().split())
c = dict()
for _ in range(n):
	(a, b) = map(int, input().split())
	for da in (-1, 0, 1):
		for db in (-1, 0, 1):
			if 2 <= a + da <= h - 1 and 2 <= b + db <= w - 1:
				c[a + da, b + db] = c.get((a + da, b + db), 0) + 1
ans_cnt = [0 for _ in range(10)]
for cnt in c.values():
	ans_cnt[cnt] += 1
ans_cnt[0] = (h - 1 - 2 + 1) * (w - 1 - 2 + 1) - sum((1 for cnt in c.values() if cnt > 0))
for i in range(10):
	print(ans_cnt[i])


import io
from collections import Counter
(nim, mike, kite, *AB) = 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 <= nim - 1 and 2 <= b - j <= mike - 1))
D = Counter((v for (_, v) in C.items()))
print((nim - 2) * (mike - 2) - sum(D.values()))
for i in range(1, 10):
	print(D[i])


(H, W, N) = map(int, input().split())
direc = [[0, 0], [-1, 0], [-2, 0], [0, -1], [-1, -1], [-2, -1], [0, -2], [-1, -2], [-2, -2]]
dic = {}
for i in range(N):
	(h, w) = map(int, input().split())
	for d in direc:
		if 1 <= h + d[0] <= H - 2 and 1 <= w + d[1] <= W - 2:
			l = (h + d[0], w + d[1])
			if l in dic:
				dic[l] = dic[l] + 1
			else:
				dic[l] = 1
A = list(dic.values())
print((H - 2) * (W - 2) - len(A))
for i in range(1, 10):
	print(A.count(i))


(H, W, N) = map(int, input().split())
D = {}
V = [-1, 0, 1]
ans = [0] * 10
ans[0] = (H - 2) * (W - 2)
for i in range(N):
	(a, b) = map(int, input().split())
	for da in V:
		if not 2 <= a + da <= H - 1:
			continue
		na = a + da
		for db in V:
			if not 2 <= b + db <= W - 1:
				continue
			nb = b + db
			cnt = D[na, nb] = D.get((na, nb), 0) + 1
			ans[cnt - 1] -= 1
			ans[cnt] += 1
print(*ans, sep='\n')


def solve(h, w, n, black_list):
	if len(black_list) == 0:
		return [(h - 2) * (w - 2)] + [0] * 9
	idx_list = []
	for (idx, (a, b)) in enumerate(black_list):
		left = max(0, b - 3)
		top = max(0, a - 3)
		for row in range(top, a):
			if row + 2 >= h:
				continue
			for col in range(left, b):
				if col + 2 >= w:
					continue
				idx_list.append(row * w + col)
	set_count = set(idx_list)
	idx_list = sorted(idx_list)
	ans = [0] * 9
	now = idx_list[0]
	count = 0
	for item in idx_list:
		if item == now:
			count += 1
		else:
			now = item
			if count == 10:
				print(item)
			ans[count - 1] += 1
			count = 1
	ans[count - 1] += 1
	return [(h - 2) * (w - 2) - len(set_count)] + ans

def __starting_point():
	(h, w, n) = list(map(int, input().split()))
	black_list = [tuple(map(int, input().split())) for _ in range(n)]
	ret = solve(h, w, n, black_list)
	for i in ret:
		print(i)
__starting_point()


(h, w, n) = map(int, input().split())
xy_pos = dict()
for i in range(n):
	(a, b) = map(int, input().split())
	for k in range(-2, 1):
		for l in range(-2, 1):
			x = a - 1 + k
			y = b - 1 + l
			if 0 <= x <= h - 1 - 2 and 0 <= y <= w - 1 - 2:
				xy = str(x) + 'x' + str(y)
				if xy in xy_pos:
					xy_pos[xy] += 1
				else:
					xy_pos[xy] = 1
ans = [0] * 10
for v in xy_pos.values():
	ans[v] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for i in range(10):
	print(ans[i])


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')
main()


from collections import Counter
from collections import defaultdict as dd
(h, w, n) = map(int, input().split())
d = dd(int)
for _ in range(n):
	(a, b) = map(int, input().split())
	for i in range(3):
		for j in range(3):
			if a - i > 0 and b - j > 0 and (a - i <= h - 2) and (b - j <= w - 2):
				d[a - i, b - j] += 1
d = dict(d)
con = Counter(d.values())
con[0] = (h - 2) * (w - 2) - sum(con.values())
for i in range(10):
	print(con[i])


from collections import defaultdict
(h, w, n) = map(int, input().split())
d = defaultdict(int)
for _ in range(n):
	(a, b) = map(int, input().split())
	for i in range(-1, 2):
		for j in range(-1, 2):
			if 1 < a + i < h and 1 < b + j < w:
				d[a + i, b + j] += 1
ans = [0] * 10
for i in d.values():
	ans[i] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for i in ans:
	print(i)


from collections import defaultdict
(h, w, n) = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
d = defaultdict(int)
for (a, b) in ab:
	for hi in range(a - 2, a + 1):
		for wi in range(b - 2, b + 1):
			if 1 <= hi <= h - 2 and 1 <= wi <= w - 2:
				d[hi, wi] += 1
cnt = [0] * 10
for v in d.values():
	cnt[v] += 1
cnt[0] = (h - 2) * (w - 2) - sum(cnt[1:])
print(*cnt, sep='\n')


from collections import defaultdict

def main():
	(H, W, N) = list(map(int, input().split(' ')))
	coord_list = [list(map(int, input().split(' '))) for _ in range(N)]
	square_count = defaultdict(int)
	for coord in coord_list:
		coord = tuple(coord)
		if coord[0] + 2 <= H and coord[1] + 2 <= W:
			square_count[coord] += 1
		if coord[0] + 2 <= H and 1 <= coord[1] - 1 and (coord[1] + 1 <= W):
			square_count[coord[0], coord[1] - 1] += 1
		if coord[0] + 2 <= H and 1 <= coord[1] - 2:
			square_count[coord[0], coord[1] - 2] += 1
		if 1 <= coord[0] - 1 and coord[0] + 1 <= H and (coord[1] + 2 <= W):
			square_count[coord[0] - 1, coord[1]] += 1
		if 1 <= coord[0] - 1 and coord[0] + 1 <= H and (1 <= coord[1] - 1) and (coord[1] + 1 <= W):
			square_count[coord[0] - 1, coord[1] - 1] += 1
		if 1 <= coord[0] - 1 and coord[0] + 1 <= H and (1 <= coord[1] - 2):
			square_count[coord[0] - 1, coord[1] - 2] += 1
		if 1 <= coord[0] - 2 and coord[1] + 2 <= W:
			square_count[coord[0] - 2, coord[1]] += 1
		if 1 <= coord[0] - 2 and 1 <= coord[1] - 1 and (coord[1] + 1 <= W):
			square_count[coord[0] - 2, coord[1] - 1] += 1
		if 1 <= coord[0] - 2 and 1 <= coord[1] - 2:
			square_count[coord[0] - 2, coord[1] - 2] += 1
	count = defaultdict(int)
	for v in list(square_count.values()):
		count[v] += 1
	count_white_only = (H - 2) * (W - 2) - sum(count.values())
	count[0] = count_white_only
	for c in range(0, 10):
		print(count[c])

def __starting_point():
	main()
__starting_point()


import sys
from collections import defaultdict, Counter

def input():
	return sys.stdin.readline().strip()
(H, W, N) = 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) = 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(covered.values())
num[0] = (H - 2) * (W - 2) - sum(num.values())
for i in range(10):
	print(num[i])


(h, w, n) = map(int, input().split())
grids = {}
D = [1, -1, 0]
for _ in range(n):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for dx in D:
		for dy in D:
			(na, nb) = (a + dx, b + dy)
			if not (0 < na < h - 1 and 0 < nb < w - 1):
				continue
			if (na, nb) not in grids:
				grids[na, nb] = 0
			grids[na, nb] += 1
ans = [0 for _ in range(10)]
for v in grids.values():
	ans[v] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for a in ans:
	print(a)


(h, w, n) = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
sa = {}
for (a, b) in ab:
	for i in range(3):
		aa = a + i
		if aa < 3 or h < aa:
			continue
		for j in range(3):
			bb = b + j
			if bb < 3 or w < bb:
				continue
			id = '%d,%d' % (aa, bb)
			sa[id] = sa.get(id, 0) + 1
s = {}
for x in sa.values():
	s[x] = s.setdefault(x, 0) + 1
print((w - 2) * (h - 2) - len(sa.keys()))
for i in range(1, 10):
	print(s.get(i, 0))


from collections import defaultdict
(h, w, n) = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(n)]
d = defaultdict(int)
L = [0] * 10
L[0] = (h - 2) * (w - 2)
for (a, b) in AB:
	for i in range(-1, 2):
		for j in range(-1, 2):
			(y, x) = (a + i, b + j)
			if 1 < y < h and 1 < x < w:
				d[y, x] += 1
				L[d[y, x]] += 1
				L[d[y, x] - 1] -= 1
print(*L, sep='\n')


(h, w, n) = list(map(int, input().split()))
dic = {}
for _ in range(n):
	(a, b) = list(map(int, input().split()))
	for i in range(a - 1, a + 2):
		for j in range(b - 1, b + 2):
			if (i, j) in list(dic.keys()):
				dic[i, j] += 1
			else:
				dic[i, j] = 1
howmany = [0 for i in range(10)]
for some in list(dic.keys()):
	(a, b) = (some[0], some[1])
	if 2 <= a <= h - 1 and 2 <= b <= w - 1:
		howmany[dic[some]] += 1
J = (h - 2) * (w - 2) - sum(howmany)
print(J)
for i in range(1, 10):
	print(howmany[i])


from collections import defaultdict

def inside(x, y):
	return 0 <= x <= h - 3 and 0 <= y <= w - 3
(h, w, n) = (int(_) for _ in input().split())
black = defaultdict(int)
for i in range(n):
	(a, b) = (int(_) - 1 for _ in input().split())
	for j in range(3):
		for k in range(3):
			(x, y) = (a - j, b - k)
			if not inside(x, y):
				continue
			black[x, y] += 1
ans = [0 for i in range(10)]
ans[0] = (h - 2) * (w - 2) - len(black)
for k in black:
	ans[black[k]] += 1
for i in range(10):
	print(ans[i])


(H, W, N) = map(int, input().split())
Nli = [0 for j in range(9 * N)]
q = 0
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[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))


F = lambda : tuple((int(X) for X in input().split()))
(H, W, N) = F()
S = {F() for _ in [0] * N}
T = set()
Z = [0] * 10
for (Y, X) in S:
	for A in range(9):
		P = (A, B) = (X - A % 3, Y - A // 3)
		if (0 < A < W - 1) * (0 < B < H - 1) * (P not in T):
			T.add(P)
			Z[sum(((B + C // 3, A + C % 3) in S for C in range(9)))] += 1
Z[0] += (H - 2) * (W - 2) - sum(Z)
print(*Z, sep='\n')


(h, w, n) = map(int, input().split())
cnt = {}
for _ in range(n):
	(a, b) = map(int, input().split())
	(a, b) = (a - 1, b - 1)
	for i in range(-1, 2):
		for j in range(-1, 2):
			if 0 < a + i < h - 1 and 0 < b + j < w - 1:
				if (a + i, b + j) not in cnt:
					cnt[a + i, b + j] = 0
				cnt[a + i, b + j] += 1
ans = {i: 0 for i in range(10)}
ans[0] = (h - 2) * (w - 2)
for (_, x) in cnt.items():
	ans[x] += 1
	ans[0] -= 1
for i in range(10):
	print(ans[i])


from collections import Counter
(H, W, N) = map(int, input().split())
Bs = []
for i in range(N):
	(x, y) = map(int, input().split())
	for xx in range(3):
		for yy in range(3):
			(tx, ty) = (x - xx, y - yy)
			if 1 <= tx and tx <= H - 2 and (1 <= ty) and (ty <= W - 2):
				Bs.append((tx, ty))
C = [0] * 10
for ((x, y), v) in Counter(Bs).most_common():
	C[v] += 1
C[0] = (H - 2) * (W - 2) - sum(C)
for i in range(10):
	print(C[i])


(H, W, N) = list(map(int, input().split()))
D = []
for _ in range(N):
	(a, b) = list(map(int, input().split()))
	for dy in (-1, 0, +1):
		y = a + dy
		if y <= 1 or y >= H:
			continue
		for dx in (-1, 0, +1):
			x = b + dx
			if x <= 1 or x >= W:
				continue
			D.append((x, y))
D = sorted(D)
i = 0
M = len(D)
ans = [0] * 10
while i < M:
	n = 1
	d = D[i]
	while i + n < M and D[i + n] == d:
		n += 1
	ans[n] += 1
	i += n
ans[0] = (H - 2) * (W - 2) - sum(ans)
print(*ans, sep='\n')


import sys
input = sys.stdin.readline
from collections import defaultdict
(H, W, N) = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
dic = defaultdict(int)
for (a, b) in AB:
	for dh in range(3):
		for dw in range(3):
			if 0 < a - dh <= H - 2 and 0 < b - dw <= W - 2:
				dic[a - dh, b - dw] += 1
Ans = [0] * 10
total = 0
for v in dic.values():
	Ans[v] += 1
	total += 1
Ans[0] = (H - 2) * (W - 2) - total
for ans in Ans:
	print(ans)


(H, W, N) = map(int, input().split())
D = {}
while N:
	N -= 1
	(x, y) = map(int, input().split())
	for i in range(9):
		a = (x + i % 3, y + i // 3)
		D[a] = D.get(a, 0) + (H >= a[0] > 2 < a[1] <= W)
c = [list(D.values()).count(i + 1) for i in range(9)]
print((H - 2) * (W - 2) - sum(c))
for i in range(9):
	print(c[i])


from collections import defaultdict
(H, W, N) = map(int, input().split())
A = defaultdict(int)
for i in range(N):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for j in range(-1, 2):
		for k in range(-1, 2):
			if 1 <= a + j < H - 1 and 1 <= b + k < W - 1:
				A[a + j, b + k] += 1
print((H - 2) * (W - 2) - len(A))
for i in range(1, 10):
	cnt = 0
	for v in A.values():
		if v == i:
			cnt += 1
	print(cnt)


from collections import defaultdict, Counter
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
(H, W, N) = map(int, input().split())
d = defaultdict(int)
for _ in range(N):
	(x, y) = map(int, input().split())
	for i in range(-2, 1):
		if 1 <= x + i <= H - 2:
			for j in range(-2, 1):
				if 1 <= y + j <= W - 2:
					d[x + i, y + j] += 1
c = Counter(d.values())
zero = (H - 2) * (W - 2) - len(d)
print(zero)
for i in range(1, 10):
	print(c[i])


import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10 ** 9))
write = lambda x: sys.stdout.write(x + '\n')
(h, w, n) = list(map(int, input().split()))
from collections import defaultdict, Counter
d = defaultdict(int)
for i in range(n):
	(a, b) = list(map(int, input().split()))
	for i in range(a - 2, a + 1):
		for j in range(b - 2, b + 1):
			if 1 <= i <= h - 2 and 1 <= j <= w - 2:
				d[i, j] += 1
ans = [None] * 10
ans[0] = (h - 2) * (w - 2) - len(d)
c = Counter(list(d.values()))
for i in range(1, 10):
	if i in c:
		ans[i] = c[i]
	else:
		ans[i] = 0
write('\n'.join(map(str, ans)))


from collections import Counter
q = []
(h, w, n) = map(int, input().split())
for i in range(n):
	(x, y) = map(int, input().split())
	for j in range(3):
		for k in range(3):
			if x - 2 + j < 1 or x - 2 + j > h - 2 or y - 2 + k < 1 or (y - 2 + k > w - 2):
				0
			else:
				q.append((x - 2 + j, y - 2 + k))
c = Counter(q)
ans = [0] * 10
while c:
	ans[c.popitem()[1]] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans[1:])
for i in ans:
	print(i)


(h, w, n) = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
x = []
di = [0, 0, 0, 1, 1, 1, 2, 2, 2]
dj = [0, 1, 2, 0, 1, 2, 0, 1, 2]
from collections import defaultdict, Counter
x = defaultdict(int)
for (a, b) in ab:
	for (ti, tj) in zip(di, dj):
		if 3 <= a + ti <= h and 3 <= b + tj <= w:
			x[a + ti, b + tj] += 1
c = Counter(x.values())
print((h - 2) * (w - 2) - sum(c.values()))
for i in range(1, 10):
	print(c[i])


(H, W, N) = map(int, input().split())
d = {}
for _ in range(N):
	(a, b) = list(map(int, input().split()))
	for dy in range(-1, 2):
		for dx in range(-1, 2):
			cy = a + dy
			cx = b + dx
			if 2 <= cy <= H - 1 and 2 <= cx <= W - 1:
				if (cy, cx) not in d:
					d[cy, cx] = 1
				else:
					d[cy, cx] += 1
ans = [0] * 10
for v in d.values():
	ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])
for i in range(10):
	print(ans[i])


from collections import defaultdict
import sys
input = sys.stdin.readline
(h, w, n) = map(int, input().split())
d = defaultdict(int)
dx = [1, 1, 1, 0, 0, 0, -1, -1, -1]
dy = [1, 0, -1, 1, 0, -1, 1, 0, -1]
for i in range(n):
	(a, b) = map(int, input().split())
	for k in range(9):
		d[a + dx[k], b + dy[k]] += 1
ans = [0] * 10
for (a, b) in d:
	if a <= 1 or b <= 1 or a > h - 1 or (b > w - 1):
		continue
	ans[d[a, b]] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for ans_i in ans:
	print(ans_i)


(h, w, n) = map(int, input().split())
D = dict()
for i in range(n):
	(a, b) = map(int, input().split())
	for p in range(-1, 2):
		for q in range(-1, 2):
			aa = a + p
			bb = b + q
			if 2 <= aa <= h - 1 and 2 <= bb <= w - 1:
				aabb = str(aa) + '_' + str(bb)
				if aabb in D:
					D[aabb] += 1
				else:
					D[aabb] = 1
ans = [0] * 10
V = list(D.values())
for v in V:
	ans[v] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for i in range(10):
	print(ans[i])


from collections import defaultdict
from itertools import product
(H, W, N) = 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) = 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 covered.values():
	values[i] += 1
values[0] = (H - 2) * (W - 2) - sum(values)
for v in values:
	print(v)


import collections
(H, W, N) = map(int, input().split())
delta = (-1, 0, 1)
ans = []
for i in range(N):
	(a, b) = map(int, input().split())
	for da in delta:
		for db in delta:
			if 1 <= a - 1 + da <= H - 2 and 1 <= b - 1 + db <= W - 2:
				ans.append((a - 1 + da, b - 1 + db))
cc = collections.Counter(collections.Counter(ans).values())
zc = (H - 2) * (W - 2) - sum(cc.values())
print(zc)
for i in range(1, 10):
	print(cc[i])


(H, W, N) = map(int, input().split())
D = dict()
for i in range(N):
	(a, b) = map(int, input().split())
	for p in range(-1, 2):
		for q in range(-1, 2):
			x = a + p
			y = b + q
			if 2 <= x <= H - 1 and 2 <= y <= W - 1:
				pos = (x, y)
				if pos in D:
					D[pos] += 1
				else:
					D[pos] = 1
ans = [0] * 10
V = list(D.values())
for v in V:
	ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
print(*ans, sep='\n')


(h, w, n) = map(int, input().split())
dic = {}
dx = [-2, -1, 0]
dy = [-2, -1, 0]
ans = [0] * 10
for _ in range(n):
	(a, b) = map(int, input().split())
	for x in dx:
		for y in dy:
			if 1 <= a + y and a + y + 2 <= h and (1 <= b + x) and (b + x + 2 <= w):
				if (a + y, b + x) not in dic:
					dic[a + y, b + x] = 1
				else:
					dic[a + y, b + x] += 1
ans[0] = (h - 2) * (w - 2) - len(dic)
for v in dic.values():
	ans[v] += 1
for i in range(10):
	print(ans[i])


from collections import defaultdict, Counter
(H, W, N) = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(N)]
d = defaultdict(int)
for (a, b) in ab:
	for da in range(3):
		aa = a - da
		if aa < 1 or H < aa + 2:
			continue
		for db in range(3):
			bb = b - db
			if bb < 1 or W < bb + 2:
				continue
			d[aa, bb] += 1
num = [0] * 10
num[0] = (H - 2) * (W - 2)
count_n = Counter(list(d.values()))
for i in range(1, 10):
	n = count_n[i]
	num[i] += n
	num[0] -= n
print(*num, sep='\n')


from itertools import product
from collections import defaultdict, Counter
(h, w, n) = map(int, input().split())
dic = defaultdict(int)
for _ in range(n):
	(y, x) = map(int, input().split())
	for (i, j) in product([-1, 0, 1], repeat=2):
		nx = x + i
		ny = y + j
		if 2 <= nx <= w - 1 and 2 <= ny <= h - 1:
			dic[nx, ny] += 1
c = Counter(dic.values())
c[0] = (w - 2) * (h - 2) - sum(c.values())
for i in range(10):
	print(c[i])


import collections
(h, w, n) = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
L = []
for i in range(n):
	for j in range(3):
		for k in range(3):
			if 0 < l[i][0] - j < h - 1 and 0 < l[i][1] - k < w - 1:
				L.append((l[i][0] - j - 1) * 10 ** 9 + l[i][1] - k - 1)
L = collections.Counter(L)
L2 = list(L.values())
ans = [0 for i in range(10)]
for i in range(len(L2)):
	ans[L2[i]] += 1
ans[0] = (h - 2) * (w - 2) - len(L2)
for i in range(10):
	print(ans[i])


from collections import defaultdict
(H, W, N) = list(map(int, input().split()))
YX = [list(map(int, input().split())) for _ in range(N)]
memo = defaultdict(int)
for (y, x) in YX:
	y -= 1
	x -= 1
	for i in range(9):
		memo[y - 1 + i // 3, x - 1 + i % 3] += 1
ans = [0] * 10
for (y, x) in memo:
	if 0 < x < W - 1 and 0 < y < H - 1:
		ans[memo[y, x]] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
print(*ans)


from collections import defaultdict
(h, w, n) = map(int, input().split())
ans = defaultdict(int)
for i in range(n):
	(a, b) = map(int, input().split())
	for j in range(0, -3, -1):
		for k in range(0, -3, -1):
			if a + j > 0 and a + j <= h - 2 and (b + k > 0) and (b + k <= w - 2):
				ans[a + j, b + k] += 1
res = [0 for i in range(10)]
for x in ans.values():
	res[x] += 1
res[0] = (h - 2) * (w - 2) - sum(res[1:])
for i in range(10):
	print(res[i])


(h, w, n) = map(int, input().split())
d = {}
s = set()
for _ in range(n):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for dy in [-2, -1, 0]:
		for dx in [-2, -1, 0]:
			(ny, nx) = (a + dy, b + dx)
			if 0 <= ny < h and 0 <= nx < w and (ny + 2 < h) and (nx + 2 < w):
				if (ny, nx) in s:
					d[ny, nx] += 1
				else:
					d[ny, nx] = 1
					s.add((ny, nx))
cnt = [0] * 10
q = 0
for v in d.values():
	cnt[v] += 1
cnt[0] = (h - 2) * (w - 2) - len(s)
for i in cnt:
	print(i)


from collections import defaultdict
(H, W, N) = map(int, input().split())
XY = []
ND = [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 0], [0, 1], [1, -1], [1, 0], [1, 1]]
M = defaultdict(int)
for i in range(N):
	(a, b) = map(int, input().split())
	XY.append([a - 1, b - 1])
	for (c, d) in ND:
		if 1 <= a - 1 + c < H - 1 and 1 <= b - 1 + d < W - 1:
			M[a - 1 + c, b - 1 + d] += 1
dict = {1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0}
cnt = 0
for (a, b) in M.items():
	dict[b] += 1
	cnt += 1
ans = (H - 2) * (W - 2) - cnt
print(ans)
for i in range(1, 10):
	print(dict[i])


from collections import defaultdict
(H, W, N) = map(int, input().split())
d = defaultdict(int)

def process(y, x):
	nonlocal d
	for nowy in range(y - 1, y + 2):
		for nowx in range(x - 1, x + 2):
			if 1 <= nowy < H - 1 and 1 <= nowx < W - 1:
				d[nowy, nowx] += 1
for i in range(N):
	(a, b) = map(int, input().split())
	process(a - 1, b - 1)
num_black = [0] * 10
for value in d.values():
	num_black[value] += 1
num_black[0] = max(0, (H - 2) * (W - 2) - sum(num_black))
for (i, a) in enumerate(num_black):
	print(a)


from collections import Counter
(h, w, n) = [int(x) for x in input().split()]
cnt = Counter()
for _ in range(n):
	(y, x) = [int(x) for x in input().split()]
	for dx in [-1, 0, 1]:
		for dy in [-1, 0, 1]:
			if 2 <= x + dx < w and 2 <= y + dy < h:
				cnt[x + dx, y + dy] += 1
cnt2 = Counter(cnt.values())
print((h - 2) * (w - 2) - sum(cnt2.values()))
for c in range(1, 10):
	print(cnt2[c])


(H, W, N) = map(int, input().split())
A = {}
for i in range(N):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for t in range(3):
		for s in range(3):
			if 0 <= a - t < H - 2 and 0 <= b - s < W - 2:
				if (a - t, b - s) not in A:
					A[a - t, b - s] = 1
				else:
					A[a - t, b - s] += 1
ans = [-1]
temp = list(A.values())
total = 0
for i in range(1, 10):
	c = temp.count(i)
	total += c
	ans.append(c)
ans[0] = (H - 2) * (W - 2) - total
print(*ans, sep='\n')


import sys
(h, w, n) = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(n)]
dict = {}
ans = [0] * 10
ans[0] = (w - 2) * (h - 2)
for item in A:
	cord = list(item)
	upcand = []
	for i in range(cord[0] - 1, cord[0] + 2):
		for j in range(cord[1] - 1, cord[1] + 2):
			upcand.append([i, j])
	for cand in upcand:
		if 1 < cand[0] < h and 1 < cand[1] < w:
			dict[cand[0], cand[1]] = dict.get((cand[0], cand[1]), 0) + 1
for (k, v) in list(dict.items()):
	ans[v] += 1
	ans[0] -= 1
for i in ans:
	print(i)


from collections import Counter, defaultdict
ans = defaultdict(lambda : 0)
(h, w, n) = map(int, input().split())
for _ in range(n):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for a_i in range(a - 2, a + 1):
		for b_i in range(b - 2, b + 1):
			if (0 <= a_i < h - 2) & (0 <= b_i < w - 2):
				ans[a_i, b_i] += 1
k = Counter(ans.values())
print((h - 2) * (w - 2) - sum(k.values()))
for i in range(1, 10):
	if i in k.keys():
		print(k[i])
	else:
		print(0)


from collections import defaultdict, Counter
(H, W, N) = map(int, input().split())
D = defaultdict(int)
for i in range(N):
	(a, b) = map(int, input().split())
	for y in range(3):
		for x in range(3):
			if 0 < a - y <= H - 2 and 0 < b - x <= W - 2:
				D[a - y, b - x] += 1
C = Counter(D.values())
SUM = sum(C.values())
print((H - 2) * (W - 2) - SUM)
for i in range(1, 10):
	print(C[i])


from collections import defaultdict
(H, W, N) = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
h = defaultdict(int)
for (a, b) in ab:
	for y in range(max([a - 2, 1]), min([a, H - 2]) + 1):
		for x in range(max([b - 2, 1]), min([b, W - 2]) + 1):
			h[y, x] += 1
ans = [0] * 10
for v in h.values():
	ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])
for a in ans:
	print(a)


(H, W, N) = map(int, input().split())
dic = {}
for _ in range(N):
	(a, b) = [int(x) - 1 for x in input().split()]
	for h in range(a, a + 3):
		for w in range(b, b + 3):
			if 0 <= h - 2 and h < H and (0 <= w - 2) and (w < W):
				dic[10 ** 10 * h + w] = dic.get(10 ** 10 * h + w, 0) + 1
ans = [0] * 10
for x in dic.values():
	ans[x] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])
for x in ans:
	print(x)


(H, W, N) = map(int, input().split())
li = []
for i in range(N):
	li.append(tuple(map(int, input().split())))
t = tuple(li)
st = set(t)
Js = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for (a, b) in t:
	if a > H - 2 or b > W - 2:
		pass
	else:
		t_p1 = ((a, b), (a, b + 1), (a, b + 2), (a + 1, b), (a + 1, b + 1), (a + 1, b + 2), (a + 2, b), (a + 2, b + 1), (a + 2, b + 2))
		s1 = st & set(t_p1)
		ls1 = len(s1)
		Js[ls1] += 1
	if a > H - 2 or b > W - 1 or b < 2:
		pass
	else:
		t_p2 = ((a, b - 1), (a, b), (a, b + 1), (a + 1, b - 1), (a + 1, b), (a + 1, b + 1), (a + 2, b - 1), (a + 2, b), (a + 2, b + 1))
		s2 = st & set(t_p2)
		ls2 = len(s2)
		Js[ls2] += 1
	if a > H - 2 or b < 3:
		pass
	else:
		t_p3 = ((a, b - 2), (a, b - 1), (a, b), (a + 1, b - 2), (a + 1, b - 1), (a + 1, b), (a + 2, b - 2), (a + 2, b - 1), (a + 2, b))
		s3 = st & set(t_p3)
		ls3 = len(s3)
		Js[ls3] += 1
	if a > H - 1 or a < 2 or b > W - 2:
		pass
	else:
		t_p4 = ((a - 1, b), (a - 1, b + 1), (a - 1, b + 2), (a, b), (a, b + 1), (a, b + 2), (a + 1, b), (a + 1, b + 1), (a + 1, b + 2))
		s4 = st & set(t_p4)
		ls4 = len(s4)
		Js[ls4] += 1
	if a > H - 1 or a < 2 or b > W - 1 or (b < 2):
		pass
	else:
		t_p5 = ((a - 1, b - 1), (a - 1, b), (a - 1, b + 1), (a, b - 1), (a, b), (a, b + 1), (a + 1, b - 1), (a + 1, b), (a + 1, b + 1))
		s5 = st & set(t_p5)
		ls5 = len(s5)
		Js[ls5] += 1
	if a > H - 1 or a < 2 or b < 3:
		pass
	else:
		t_p6 = ((a - 1, b - 2), (a - 1, b - 1), (a - 1, b), (a, b - 2), (a, b - 1), (a, b), (a + 1, b - 2), (a + 1, b - 1), (a + 1, b))
		s6 = st & set(t_p6)
		ls6 = len(s6)
		Js[ls6] += 1
	if a < 3 or b > W - 2:
		pass
	else:
		t_p7 = ((a - 2, b), (a - 2, b + 1), (a - 2, b + 2), (a - 1, b), (a - 1, b + 1), (a - 1, b + 2), (a, b), (a, b + 1), (a, b + 2))
		s7 = st & set(t_p7)
		ls7 = len(s7)
		Js[ls7] += 1
	if a < 3 or b > W - 1 or b < 2:
		pass
	else:
		t_p8 = ((a - 2, b - 1), (a - 2, b), (a - 2, b + 1), (a - 1, b - 1), (a - 1, b), (a - 1, b + 1), (a, b - 1), (a, b), (a, b + 1))
		s8 = st & set(t_p8)
		ls8 = len(s8)
		Js[ls8] += 1
	if a < 3 or b < 3:
		pass
	else:
		t_p9 = ((a - 2, b - 2), (a - 2, b - 1), (a - 2, b), (a - 1, b - 2), (a - 1, b - 1), (a - 1, b), (a, b - 2), (a, b - 1), (a, b))
		s9 = st & set(t_p9)
		ls9 = len(s9)
		Js[ls9] += 1
for i in range(1, 10):
	Js[i] = Js[i] // i
all = (H - 2) * (W - 2)
Js[0] = all - sum(Js)
for i in range(10):
	print(Js[i])


(H, W, N) = map(int, input().split())
Draw = [tuple(map(int, input().split())) for _ in range(N)]
from collections import defaultdict as dd
Sq = dd(lambda : 0)
In = lambda x, y: [(x - i, y - j) for i in range(3) for j in range(3) if 0 <= x - i < H - 2 and 0 <= y - j < W - 2]
for (a, b) in Draw:
	for (x, y) in In(a - 1, b - 1):
		Sq[x, y] += 1
Ans = [(H - 2) * (W - 2) - len(Sq)] + [sum((v == i for v in Sq.values())) for i in range(1, 10)]
for ans in Ans:
	print(ans)


(H, W, N) = map(int, input().split())
Ans = [0] * 10
Ans[0] = (H - 2) * (W - 2)
from collections import defaultdict
G = defaultdict(int)
for i in range(N):
	(a, b) = map(int, input().split())
	for j in range(-1, 2):
		for k in range(-1, 2):
			if 1 < a + j < H and 1 < b + k < W:
				G[a + j, b + k] += 1
for (k, v) in G.items():
	if 1 < k[0] < H and 1 < k[1] < W:
		Ans[v] += 1
		Ans[0] -= 1
for a in Ans:
	print(a)


f = lambda : map(int, input().split())
(h, w, n) = f()
d = {}
while n:
	n -= 1
	(x, y) = f()
	for i in range(9):
		a = (x + i % 3, y + i // 3)
		d[a] = d.get(a, 0) + (h >= a[0] > 2 < a[1] <= w)
c = [list(d.values()).count(i + 1) for i in range(9)]
print((h - 2) * (w - 2) - sum(c))
for i in range(9):
	print(c[i])


from collections import Counter
(h, w, n) = list(map(int, input().split()))
c = Counter([])
for i in range(n):
	(a, b) = list(map(int, input().split()))
	a -= 1
	b -= 1
	for i in range(-2, 1):
		for j in range(-2, 1):
			if 0 <= a + i < h - 2 and 0 <= b + j < w - 2:
				c[a + i, b + j] += 1
ans = [0] * 10
total = 0
for (k, v) in list(c.items()):
	ans[v] += 1
	total += 1
ans[0] = (h - 2) * (w - 2) - total
for a in ans:
	print(a)


from collections import defaultdict
from itertools import product
(H, W, N) = map(int, input().split())
cnt = defaultdict(int)
D = tuple(product((-1, 0, 1), repeat=2))
for _ in range(N):
	(a, b) = map(int, input().split())
	for (dh, dw) in D:
		h = a + dh
		w = b + dw
		if 2 <= h <= H - 1 and 2 <= w <= W - 1:
			cnt[h, w] += 1
ans = [0] * 10
for c in cnt.values():
	ans[c] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
print(*ans, sep='\n')


from collections import Counter as C
(H, W, N, *L) = map(int, open(0).read().split())
K = []
M = [(H - 2) * (W - 2)] + [0] * 9
for (a, b) in zip(*[iter(L)] * 2):
	for c in range(9):
		x = b - c // 3
		y = a - c % 3
		if H - 1 > y > 0 < x < W - 1:
			K += [y * W + x]
for (k, v) in C(C(K).values()).items():
	M[0] -= v
	M[k] += v
print(*M)


from collections import defaultdict
(H, W, N) = map(int, input().split())
D = defaultdict(int)
for i in range(N):
	(h, w) = map(int, input().split())
	(h, w) = (h - 1, w - 1)
	for dh in range(-1, 2):
		for dw in range(-1, 2):
			if not (1 <= h + dh < H - 1 and 1 <= w + dw < W - 1):
				continue
			D[h + dh, w + dw] += 1
ans = [0] * 10
for v in D.values():
	ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])
print(*ans, sep='\n')


(h, w, n) = 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) = 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 cnt.values():
	jl[0] -= 1
	jl[i] += 1
for i in jl:
	print(i)


from collections import defaultdict, Counter

def main():
	(H, W, N, *A) = map(int, open(0).read().split())
	D = defaultdict(int)
	while A:
		(b, a) = (A.pop(), A.pop())
		for i in [a - 2, a - 1, a]:
			if 1 <= i <= H - 2:
				for j in [b - 2, b - 1, b]:
					if 1 <= j <= W - 2:
						D[i, j] += 1
	print((H - 2) * (W - 2) - len(D))
	c = Counter(D.values())
	for i in range(1, 10):
		print(c.get(i, 0))
main()


import sys
input = sys.stdin.buffer.readline
from collections import defaultdict
(H, W, N) = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
counter = defaultdict(int)
for (a, b) in AB:
	for aa in range(a - 1, a + 2):
		for bb in range(b - 1, b + 2):
			if 2 <= aa <= H - 1 and 2 <= bb <= W - 1:
				counter[aa, bb] += 1
answer = [0] * 10
for ((x, y), n) in list(counter.items()):
	if n:
		answer[n] += 1
answer[0] = (H - 2) * (W - 2)
for i in range(1, 10):
	answer[0] -= answer[i]
for a in answer:
	print(a)


import math
import heapq
import bisect
import numpy as np
from collections import Counter, deque
import itertools
(H, W, N) = map(int, input().split())
L = []
for _ in range(N):
	(a, b) = map(int, input().split())
	for i in range(3):
		if a + i - 1 <= 1 or a + i - 1 >= H:
			continue
		for j in range(3):
			if b + j - 1 <= 1 or b + j - 1 >= W:
				continue
			L.append((a + i - 1, b + j - 1))
L.sort()
C = Counter(L)
ans = [0] * 10
for value in C.values():
	ans[value] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])
print('\n'.join(map(str, ans)))


from collections import Counter
(h, w, n) = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(n)]
d = (-1, 0, 1)
c = Counter()
for (a, b) in ab:
	for da in d:
		for db in d:
			aa = a + da
			bb = b + db
			if 2 <= aa <= h - 1 and 2 <= bb <= w - 1:
				c[aa, bb] += 1
ans = Counter(c.values())
count_0 = (h - 2) * (w - 2) - sum(ans.values())
print(count_0)
for i in range(1, 10):
	print(ans[i])


from collections import defaultdict, Counter
(h, w, n) = map(int, input().split())
ans = [0] * 10
d = defaultdict(int)
for i in range(n):
	(a, b) = map(int, input().split())
	for j in range(max(2, a - 1), min(a + 2, h)):
		for k in range(max(2, b - 1), min(b + 2, w)):
			d[j, k] += 1
c = Counter(d.values())
print((h - 2) * (w - 2) - sum(c.values()))
for i in range(1, 10):
	print(c[i])


(h, w, n) = map(int, input().split())
from collections import Counter
d = []
for _ in range(n):
	(a, b) = map(int, input().split())
	for k in range(3):
		for l in range(3):
			if 0 < a - k < h - 1 and 0 < b - l < w - 1:
				d.append((a - k, b - l))
dd = Counter(d)
ddd = list(dd.values())
ans = [0] * 10
for i in range(1, 10):
	ans[i] = ddd.count(i)
ans[0] = (h - 2) * (w - 2) - sum(ans)
for x in ans:
	print(x)


from collections import Counter
(h, w, N) = map(int, input().split())
rec = []
for i in range(N):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for i in range(-2, 1):
		for j in range(-2, 1):
			if 0 <= a + i < h - 2 and 0 <= b + j < w - 2:
				rec.append((a + i, b + j))
ans = [0] * 10
ans[0] = (h - 2) * (w - 2)
c = Counter(rec)
for i in c.values():
	ans[i] += 1
	ans[0] -= 1
for i in range(10):
	print(ans[i])


from collections import Counter
(H, W, N) = map(int, input().split())
ddx = [0, 0, 0, 1, 1, 1, -1, -1, -1]
ddy = [-1, 0, 1, -1, 0, 1, -1, 0, 1]
cnt = []
for _ in range(N):
	(y, x) = map(int, input().split())
	for (dx, dy) in zip(ddx, ddy):
		yy = y + dy
		xx = x + dx
		if 1 < yy < H and 1 < xx < W:
			cnt.append(yy * W + xx)
cnt = Counter(cnt)
ans = [0] * 10
ans[0] = (H - 2) * (W - 2)
for k in cnt:
	c = cnt[k]
	ans[c] += 1
	ans[0] -= 1
for i in ans:
	print(i)


import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15
from collections import deque, defaultdict, Counter

def main():
	(H, W, N) = map(int, input().split())
	point = [tuple(map(int, input().split())) for _ in range(N)]
	ans = [0] * 10
	dic = defaultdict(int)
	for (p, q) in point:
		for dy in (-1, 0, 1):
			for dx in (-1, 0, 1):
				if p + dy <= 1 or p + dy >= H:
					continue
				if q + dx <= 1 or q + dx >= W:
					continue
				center = (p + dy, q + dx)
				ans[dic[center]] -= 1
				dic[center] += 1
				ans[dic[center]] += 1
	ans[0] += (H - 2) * (W - 2)
	print('\n'.join(map(str, ans)))

def __starting_point():
	main()
__starting_point()


from itertools import product
from collections import defaultdict, Counter
import sys
input = sys.stdin.readline
(h, w, n) = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
pls = defaultdict(int)
for (x, y) in a:
	for (arx, ary) in product(list(range(x - 1, x + 2)), list(range(y - 1, y + 2))):
		if 2 <= arx <= h - 1 and 2 <= ary <= w - 1:
			pls[arx, ary] += 1
c = Counter(pls.values())
print((h - 2) * (w - 2) - sum(c.values()))
for i in range(1, 10):
	print(c[i])


(h, w, n) = map(int, input().split())
from itertools import product as p
from collections import Counter as c
I = [list(map(int, input().split())) for i in [0] * n]
ans = [0] * 9
for (k, v) in c(c([(a - x) * w + b - y for (x, y) in p(range(3), repeat=2) for (a, b) in I if h - 1 > a - x > 0 < b - y < w - 1]).values()).items():
	ans[k - 1] = v
print((h - 2) * (w - 2) - sum(ans), *ans, sep='\n')


from collections import defaultdict
(H, W, N) = map(int, input().split())
dic = defaultdict(int)
for i in range(N):
	(a, b) = map(int, input().split())
	for j in range(3):
		for k in range(3):
			if 1 <= a + j - 2 <= H - 2 and 1 <= b + k - 2 <= W - 2:
				dic[a + j - 2, b + k - 2] += 1
rec = [0] * 10
for k in dic.values():
	rec[k] += 1
rec[0] = (H - 2) * (W - 2) - sum(rec)
for i in rec:
	print(i)


import itertools
(H, W, N) = [int(_) for _ in input().split()]
AB = [[int(_) for _ in input().split()] for _ in range(N)]
memo = {}
for (a, b) in AB:
	a -= 1
	b -= 1
	for (na, nb) in itertools.product(range(a - 2, a + 1), range(b - 2, b + 1)):
		if na in range(H - 2) and nb in range(W - 2):
			memo[na + H * nb] = memo.get(na + H * nb, 0) + 1
result = [0] * 10
for (k, v) in memo.items():
	result[v] += 1
result[0] = (H - 2) * (W - 2) - sum(result)
[print(_) for _ in result]


(h, w, n) = (int(i) for i in input().split())
x = [[int(i) for i in input().split()] for i in range(n)]

def sq(a, b, h, w):
	(A, B, X) = ([a - 2, a - 1, a], [b - 2, b - 1, b], [])
	for i in A:
		for j in B:
			if 1 <= i <= h - 2 and 1 <= j <= w - 2:
				X.append((i, j))
	return X
(y, ans) = ([], [0 for i in range(10)])
for (i, j) in x:
	y += sq(i, j, h, w)
from collections import Counter
for ((i, j), k) in Counter(y).most_common():
	ans[k] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for i in ans:
	print(i)


from collections import Counter
(h, w, n) = map(int, input().split())
d = {}
for _ in range(n):
	(a, b) = map(int, input().split())
	for i in range(max(a - 2, 1), a + 1):
		for j in range(max(b - 2, 1), b + 1):
			if h < i + 2 or w < j + 2:
				continue
			if (i, j) in d:
				d[i, j] += 1
			else:
				d[i, j] = 1
ans = [0] * 10
ans[0] = (h - 2) * (w - 2)
for (k, v) in d.items():
	ans[v] += 1
	ans[0] -= 1
for a in ans:
	print(a)


from collections import *
(h, w, n) = map(int, input().split())
dic = defaultdict(int)
for _ in range(n):
	(a, b) = map(int, input().split())
	for i in range(9):
		dic[a - i // 3, b - i % 3] += 1
ans = [0] * 10
for (i, j) in dic:
	ans[dic[i, j]] += h - 1 > i > 0 < j < w - 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for item in ans:
	print(item)


from collections import defaultdict, Counter
(H, W, N) = map(int, input().split())
D = defaultdict(int)
for _ in range(N):
	(a, b) = map(int, input().split())
	for i in range(a - 2, a + 1):
		if 1 <= i <= H - 2:
			for j in range(b - 2, b + 1):
				if 1 <= j <= W - 2:
					D[i, j] += 1
print((H - 2) * (W - 2) - len(D))
c = Counter(D.values())
for i in range(1, 10):
	print(c.get(i, 0))


(H, W, N) = map(int, input().split())
dic = {}
for i in range(N):
	(a, b) = map(int, input().split())
	for dh in range(3):
		for dw in range(3):
			if 0 < a - dh <= H - 2 and 0 < b - dw <= W - 2:
				if (a - dh, b - dw) not in dic.keys():
					dic[a - dh, b - dw] = 1
				else:
					dic[a - dh, b - dw] += 1
Ans = [0] * 10
total = 0
for v in dic.values():
	Ans[v] += 1
	total += 1
Ans[0] = (H - 2) * (W - 2) - total
for ans in Ans:
	print(ans)


(H, W, N) = list(map(int, input().split()))
dic = {}
for _ in range(N):
	(a, b) = list(map(int, input().split()))
	for i in range(-1, 2):
		for j in range(-1, 2):
			if a + i <= 1 or b + j <= 1 or a + i >= H or (b + j >= W):
				continue
			s = (a + i) * W + b + j
			if dic.get(s, 0) == 0:
				dic[s] = 1
			else:
				dic[s] += 1
arr = [0 for i in range(10)]
for v in dic.values():
	arr[v] += 1
arr[0] = (H - 2) * (W - 2) - sum(arr)
for x in arr:
	print(x)


from collections import defaultdict

def main():
	(H, W, N) = map(int, input().split())
	offset = [[i, j] for i in range(-1, 2) for j in range(-1, 2)]
	ans = [0] * 10
	ans[0] = (H - 2) * (W - 2)
	memo = defaultdict(int)
	for i in range(N):
		(a, b) = map(int, input().split())
		for o in offset:
			if a + o[0] < 2 or H - 1 < a + o[0]:
				continue
			if b + o[1] < 2 or W - 1 < b + o[1]:
				continue
			memo[a - 1 + o[0], b - 1 + o[1]] += 1
	for v in memo.values():
		ans[v] += 1
		ans[0] -= 1
	for i in range(10):
		print(ans[i])
main()


(h, w, n) = map(int, input().split())
cnts = [0] * 10
cnts[0] = (h - 2) * (w - 2)
points = dict()
for _ in range(n):
	(a, b) = map(lambda x: int(x) - 1, input().split())
	for i in (-1, 0, 1):
		for j in (-1, 0, 1):
			(ai, bj) = (a + i, b + j)
			if 1 <= ai < h - 1 and 1 <= bj < w - 1:
				ab = (a + i, b + j)
				points.setdefault(ab, 0)
				cnts[points[ab]] -= 1
				points[ab] += 1
				cnts[points[ab]] += 1
for c in cnts:
	print(c)


import collections
from itertools import product
(H, W, N) = map(int, input().split())
PaintList = []
pat = list(product((-2, -1, 0), repeat=2))
for i in range(N):
	(x, y) = map(int, input().split())
	for p in pat:
		xw = x + p[0]
		yw = y + p[1]
		if 1 <= xw <= H - 2 and 1 <= yw <= W - 2:
			PaintList.append((xw, yw))
c = collections.Counter(PaintList)
ans = [0] * 10
for (k, v) in c.items():
	if k[0] <= H - 2 and k[1] <= W - 2:
		ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans[1:10])
for i in range(10):
	print(ans[i])


from collections import defaultdict
(H, W, N) = map(int, input().split())
d = defaultdict(int)
for i in range(N):
	(a, b) = map(int, input().split())
	for dy in range(-1, 2):
		for dx in range(-1, 2):
			if a + dy >= 2 and a + dy <= H - 1 and (b + dx >= 2) and (b + dx <= W - 1):
				d[a + dy, b + dx] += 1
ans = [0] * 10
ans[0] = (H - 2) * (W - 2) - len(d)
for i in d.values():
	ans[i] += 1
for i in ans:
	print(i)


def main():
	from sys import stdin
	input = stdin.readline
	(h, w, n) = map(int, input().split())
	ab = [list(map(int, input().split())) for _ in [0] * n]
	ans = [0] * 10
	d = {}
	for (a, b) in ab:
		for j in range(-1, 2):
			for k in range(-1, 2):
				d[a + j, b + k] = d.get((a + j, b + k), 0) + 1
	for ((i, j), k) in d.items():
		if 2 <= i < h and 2 <= j < w:
			ans[k] += 1
	print((h - 2) * (w - 2) - sum(ans))
	for i in ans[1:]:
		print(i)
main()


import sys

def getsqs(coor, h, w):
	l = [coor[0] + x + h * (coor[1] + y - 1) for x in range(-1, 2) for y in range(-1, 2) if coor[0] + x > 1 and coor[0] + x < h and (coor[1] + y > 1) and (coor[1] + y < w)]
	return l

def main(h, w, coords):
	sq = []
	ans = [0 for _ in range(10)]
	for coor in coords:
		sq.extend(getsqs(coor, h, w))
	sq.sort()
	sq.append(h * w)
	ind = 0
	for x in range(len(sq) - 1):
		if sq[x + 1] - sq[x] != 0:
			ans[x - ind + 1] += 1
			ind = x + 1
	ans[0] = max(0, (h - 2) * (w - 2) - sum(ans))
	return ans
(h, w, n) = list(map(int, sys.stdin.readline().strip().split()))
coords = [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]
for x in main(h, w, coords):
	print(x)


def main():
	(h, w, n) = map(int, input().split())
	color_dict = {}
	for i in range(n):
		(a, b) = map(int, input().split())
		for j in range(a - 2, a + 1):
			for k in range(b - 2, b + 1):
				if 1 <= j <= h - 2 and 1 <= k <= w - 2:
					color_dict[j, k] = color_dict.get((j, k), 0) + 1
	times = [0 for i in range(10)]
	for i in color_dict:
		times[color_dict[i]] += 1
	times[0] = (h - 2) * (w - 2) - len(color_dict)
	for i in times:
		print(i)
main()


from collections import defaultdict
(h, w, n) = map(int, input().split())
x = []
for i in range(n):
	x.append(list(map(int, input().split())))
d = defaultdict(int)
for i in x:
	a = []
	for j in range(3):
		for k in range(3):
			if i[0] - j - 1 >= 0 and i[1] - k - 1 >= 0 and (i[0] - j - 1 <= h - 3) and (i[1] - k - 1 <= w - 3):
				a.append((i[0] - j - 1, i[1] - k - 1))
	for j in a:
		d[j] += 1
a = list(d.values())
ans = [0] * 10
ans[0] = (h - 2) * (w - 2) - len(a)
for i in a:
	ans[i] += 1
for i in ans:
	print(i)


(h, w, n) = map(int, input().split())
memo = {}
dxy = [(0, 1), (0, 0), (1, 0), (-1, 0), (0, -1), (1, 1), (-1, -1), (-1, 1), (1, -1)]
for i in range(n):
	(a, b) = map(int, input().split())
	for (dx, dy) in dxy:
		(x, y) = (a + dx, b + dy)
		if 1 < x < h and 1 < y < w:
			if (x, y) not in memo:
				memo[x, y] = 0
			memo[x, y] += 1
ans = [0 for i in range(10)]
for (k, v) in memo.items():
	ans[v] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
[print(i) for i in ans]


(h, w, n) = map(int, input().split())
from itertools import product as pr
from collections import Counter as co
ans = [(h - 2) * (w - 2)] + [0] * 9
io = [tuple(map(int, input().split())) for i in range(n)]
for (k, v) in co(co([(a - x) * w + b - y for (x, y) in pr(range(3), repeat=2) for (a, b) in io if h - 1 > a - x > 0 < b - y < w - 1]).values()).items():
	ans[k] = v
	ans[0] -= v
print(*ans, sep='\n')


from collections import Counter, defaultdict
(h, w, n) = map(int, input().split())
dic = defaultdict(int)
for _ in range(n):
	(a, b) = map(int, input().split())
	for y in range(a - 2, a + 1):
		for x in range(b - 2, b + 1):
			if 1 <= y <= h - 2 and 1 <= x <= w - 2:
				dic[x, y] += 1
counter = Counter(dic.values())
cntSum = (w - 2) * (h - 2)
counter[0] = cntSum - sum(counter.values())
for k in range(10):
	print(counter[k])


from collections import *
(h, w, _, *t) = map(int, open(0).read().split())
d = defaultdict(int)
for (a, b) in zip(*[iter(t)] * 2):
	for i in range(9):
		d[a - i // 3, b - i % 3] += 1
a = [0] * 10
for (i, j) in d:
	a[d[i, j]] += h - 1 > i > 0 < j < w - 1
a[0] = (h - 2) * (w - 2) - sum(a)
print(*a)


from collections import Counter
from itertools import product
(H, W, N, *AB) = 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 C.items()))
print((H - 2) * (W - 2) - sum(D.values()))
for i in range(1, 10):
	print(D[i])


import sys
from collections import Counter
INF = float('inf')
XX = (-2, -2, -2, -1, -1, -1, 0, 0, 0)
YY = (-2, -1, 0, -2, -1, 0, -2, -1, 0)

def solve(H: int, W: int, N: int, a: 'List[int]', b: 'List[int]'):
	counter = Counter()
	for (aa, bb) in zip(a, b):
		for (x, y) in zip(XX, YY):
			if aa + x < 1:
				continue
			elif aa + x + 2 > H:
				continue
			elif bb + y < 1:
				continue
			elif bb + y + 2 > W:
				continue
			counter[aa + x, bb + y] += 1
	ans = [0] * 10
	for (key, val) in counter.items():
		ans[val] += 1
	ans[0] = (H - 2) * (W - 2) - sum(ans)
	print(*ans, sep='\n')
	return

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	H = int(next(tokens))
	W = int(next(tokens))
	N = int(next(tokens))
	a = [int()] * N
	b = [int()] * N
	for i in range(N):
		a[i] = int(next(tokens))
		b[i] = int(next(tokens))
	solve(H, W, N, a, b)

def __starting_point():
	main()
__starting_point()


from collections import defaultdict
(h, w, n) = map(int, input().split())
count = defaultdict(int)
for i in range(n):
	(a, b) = map(int, input().split())
	for s in range(3):
		if a + s - 2 < 1 or a + s - 2 > h - 2:
			continue
		for t in range(3):
			if b - 2 + t < 1 or b - 2 + t > w - 2:
				continue
			count[a - 2 + s, b - 2 + t] += 1
ans = [0] * 10
for (key, val) in count.items():
	ans[val] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans[1:])
print(*ans, sep='\n')


from collections import Counter as C
r = range(3)

def s():
	(H, W, N, *L) = map(int, open(0).read().split())
	D = {}
	M = [(H - 2) * (W - 2)] + [0] * 9
	for (a, b) in zip(*[iter(L)] * 2):
		for x in r:
			for y in r:
				if H - 1 > a - y > 0 < b - x < W - 1:
					t = (a - y) * W + b - x
					D[t] = D.get(t, 0) + 1
	for (k, v) in C(D.values()).items():
		M[0] -= v
		M[k] += v
	print(*M)
s()


import sys
input = sys.stdin.readline
(H, W, N) = map(int, input().split())
AB = [tuple(map(int, input().split())) for i in range(N)]
from collections import defaultdict
dic = defaultdict(lambda : 0)
for (y, x) in AB:
	for dx in range(-1, 2):
		for dy in range(-1, 2):
			(nx, ny) = (x + dx, y + dy)
			if not 1 <= nx <= W:
				continue
			if not 1 <= ny <= H:
				continue
			dic[nx, ny] += 1
ans = [0] * 10
for ((x, y), c) in dic.items():
	if x == 1 or x == W or y == 1 or (y == H):
		continue
	ans[c] += 1
s = sum(ans)
ans[0] = (W - 2) * (H - 2) - s
print(*ans, sep='\n')


import sys
from collections import defaultdict
input = sys.stdin.buffer.readline
count = defaultdict(lambda : 0)
(H, W, N) = map(int, input().split())
for _ in range(N):
	(a, b) = map(int, input().split())
	for a_2 in range(a - 1, a + 2):
		for b_2 in range(b - 1, b + 2):
			if 2 <= a_2 <= H - 1 and 2 <= b_2 <= W - 1:
				count[a_2, b_2] += 1
ans = [0] * 10
for (_, v) in count.items():
	ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
print(*ans, sep='\n')


import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy
(H, W, N) = map(int, input().split())
m = {}
for i in range(N):
	(a, b) = map(int, input().split())
	for j in range(-2, 1):
		for k in range(-2, 1):
			if not 1 <= a + j <= H - 2 or not 1 <= b + k <= W - 2:
				continue
			m[a + j, b + k] = m.get((a + j, b + k), 0) + 1
ans = [0] * 10
for (k, v) in m.items():
	ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans[1:10])
for i in range(10):
	print(ans[i])


from collections import Counter
(h, w, n) = map(int, input().split())
need = []
append = need.append
for i in range(n):
	(a, b) = map(int, input().split())
	for x in range(-2, 1):
		for y in range(-2, 1):
			s = a + x
			t = b + y
			if 1 <= s <= h - 2 and 1 <= t <= w - 2:
				append(s * 10 ** 10 + t)
data = Counter(need).most_common()
ans = [0 for i in range(10)]
for (x, y) in data:
	ans[y] += 1
print((h - 2) * (w - 2) - sum(ans))
for i in ans[1:]:
	print(i)


from collections import defaultdict, Counter
(H, W, N) = list(map(int, input().split()))
L = []
for _ in range(N):
	(a, b) = list(map(int, input().split()))
	L.append([a, b])
d = defaultdict()
for i in range(N):
	for sx in range(3):
		for sy in range(3):
			if 3 <= L[i][0] + sx <= H and 3 <= L[i][1] + sy <= W:
				if (L[i][0] + sx, L[i][1] + sy) not in d:
					d[L[i][0] + sx, L[i][1] + sy] = 1
				else:
					d[L[i][0] + sx, L[i][1] + sy] += 1
c = Counter(list(d.values()))
ans = [0 for _ in range(10)]
for (k, v) in list(c.items()):
	if v > 0:
		ans[k] = v
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])
for i in ans:
	print(i)


import collections
(H, W, N) = map(int, input().split(' '))
point_frq_dict = collections.defaultdict(int)
for _ in range(N):
	(a, b) = map(int, input().split(' '))
	for i in range(3):
		for j in range(3):
			if 0 < a - i < H - 1 and 0 < b - j < W - 1:
				point_frq_dict[a - i, b - j] += 1
ans = [0 for _ in range(10)]
n = 0
for frq in point_frq_dict.values():
	ans[frq] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
for a in ans:
	print(a)


(h, w, n) = map(int, input().split())
from collections import defaultdict
dic = defaultdict(int)
for _ in range(n):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for aa in range(a - 1, a + 2):
		for bb in range(b - 1, b + 2):
			if 1 <= aa <= h - 2 and 1 <= bb <= w - 2:
				dic[aa, bb] += 1
ans = [0 for i in range(10)]
for i in dic.values():
	ans[i] += 1
ans[0] = (h - 2) * (w - 2) - sum([ans[i] for i in range(1, 10)])
for anss in ans:
	print(anss)


(H, W, N) = map(int, input().split())
ab = [list(map(int, input().split())) for _ in [0] * N]
d = {}
for (a, b) in ab:
	for i in (a - 1, a, a + 1):
		for j in (b - 1, b, b + 1):
			d[i, j] = d.get((i, j), 0) + 1
cnt = [0] * 10
for (k, v) in d.items():
	(a, b) = k
	if a < 2 or b < 2:
		continue
	if a > H - 1 or b > W - 1:
		continue
	cnt[v] += 1
cnt[0] = (W - 2) * (H - 2) - sum(cnt)
for ans in cnt:
	print(ans)


from collections import Counter
(h, w, n) = map(int, input().split())
black_count = {}
for _ in range(n):
	(a, b) = map(int, input().split())
	for dx in (-1, 0, 1):
		for dy in (-1, 0, 1):
			y = a + dy
			x = b + dx
			if 2 <= y <= h - 1 and 2 <= x <= w - 1:
				black_count[y, x] = black_count.get((y, x), 0) + 1
ans = Counter(black_count.values())
ans[0] = (h - 2) * (w - 2) - sum(ans.values())
for i in range(10):
	print(ans.get(i, 0))


(H, W, N) = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(N)]
from itertools import product
S = [set() for _ in range(10)]
memo = {}
for (a, b) in AB:
	for (x, y) in product([-1, 0, 1], repeat=2):
		X = a + x - 1
		Y = b + y - 1
		if X <= 0 or H - 1 <= X or Y <= 0 or (W - 1 <= Y):
			continue
		memo[X, Y] = memo.get((X, Y), 0) + 1
from collections import Counter
c = Counter(memo.values())
L = [c.get(i, 0) for i in range(1, 10)]
print((H - 2) * (W - 2) - sum(L))
for l in L:
	print(l)


from collections import Counter, defaultdict
from itertools import product
(H, W, N) = map(int, input().split())
c = defaultdict(int)
for _ in range(N):
	(a, b) = map(int, input().split())
	for (dx, dy) in product([-1, 0, 1], repeat=2):
		y = a - 2 + dy
		x = b - 2 + dx
		if 0 <= y < H - 2 and 0 <= x < W - 2:
			c[x, y] += 1
ans = Counter(c.values())
print((H - 2) * (W - 2) - sum(ans.values()))
for i in range(1, 10):
	print(ans[i])


from collections import defaultdict
(H, W, N) = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(N)]
d = defaultdict(lambda : 0)

def count(a, b):
	for dx1 in [-1, 0, 1]:
		for dy1 in [-1, 0, 1]:
			(x, y) = (a + dx1, b + dy1)
			if 2 <= x < H and 2 <= y < W:
				d[x, y] += 1
for i in range(N):
	count(*ab[i])
ans = defaultdict(lambda : 0)
for (x, y) in d:
	ans[d[x, y]] += 1
ans[0] = (H - 2) * (W - 2)
for i in range(1, 10):
	ans[0] -= ans[i]
for i in range(10):
	print(ans[i])


from collections import defaultdict as dd
(H, W, N) = map(int, input().split())
res = [0] * 10
res[0] = H * W - 2 * H - 2 * W + 4
p = dd(int)
d = [-1, 0, 1]
for _ in range(N):
	(y, x) = map(int, input().split())
	for i in d:
		for j in d:
			if 1 < y + i < H and 1 < x + j < W:
				p[(y + i) * (H * W + 1) + x + j] += 1
for k in p.keys():
	res[p[k]] += 1
	res[0] -= 1
for r in res:
	print(r)


(h, w, n) = map(int, input().split())
dic = {}
for i in range(n):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for i in range(-1, 2):
		for j in range(-1, 2):
			if a + i <= 0 or a + i >= h - 1 or b + j <= 0 or (b + j >= w - 1):
				continue
			if (a + i, b + j) in dic:
				dic[a + i, b + j] += 1
			else:
				dic[a + i, b + j] = 1
count = [0] * 10
for i in dic.values():
	count[i] += 1
count[0] = (h - 2) * (w - 2) - sum(count)
for i in range(10):
	print(count[i])


import sys
input = sys.stdin.readline
from collections import defaultdict
(H, W, N) = map(int, input().split())
cnt = defaultdict(lambda : 0)
for i in range(N):
	(a, b) = map(lambda x: int(x) - 1, input().split())
	for y in range(a - 2, a + 1):
		for x in range(b - 2, b + 1):
			if 0 <= y < H - 2 and 0 <= x < W - 2:
				cnt[y, x] += 1
ans = [0] * 10
for key in cnt:
	ans[cnt[key]] += 1
ans[0] += ans[0] + (H - 2) * (W - 2) - len(cnt)
for i in ans:
	print(i)


from collections import defaultdict
import sys
input = sys.stdin.readline
(h, w, n) = map(int, input().split())
d = defaultdict()
ans = [0] * 10
for k in range(n):
	(a, b) = map(int, input().split())
	a -= 1
	b -= 1
	for i in range(-1, 2):
		for j in range(-1, 2):
			if (a + i, b + j) in d:
				d[a + i, b + j] += 1
			else:
				d[a + i, b + j] = 1
for (k, v) in d.items():
	if 0 < k[0] < h - 1 and 0 < k[1] < w - 1:
		ans[v] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for i in ans:
	print(i)


from collections import defaultdict
import sys
input = sys.stdin.readline
(H, W, N) = map(int, input().split())
count = defaultdict(int)
for _ in range(N):
	(a, b) = map(int, input().split())
	for da in range(3):
		for db in range(3):
			(na, nb) = (a - da, b - db)
			if 1 <= na <= H - 2 and 1 <= nb <= W - 2:
				count[na, nb] += 1
ans = [0] * 10
for (k, v) in count.items():
	ans[v] += 1
ans[0] = (H - 2) * (W - 2) - sum(ans)
print(*ans, sep='\n')


from collections import Counter
(H, W, N) = map(int, input().split())
ab = []
corner = []
countlist = [0 for i in range(10)]
for i in range(N):
	(a, b) = map(int, input().split())
	for h in range(-2, 1):
		for w in range(-2, 1):
			if 1 <= a + h <= H - 2 and 1 <= b + w <= W - 2:
				corner.append((a + h, b + w))
cc = Counter(corner)
clist = list(cc.values())
clistc = Counter(clist)
for (k, v) in clistc.items():
	countlist[k] += v
countlist[0] = (H - 2) * (W - 2) - sum(countlist)
for i in countlist:
	print(i)


from collections import defaultdict, Counter
d = defaultdict(int)
(h, w, n) = map(int, input().split())
for _ in range(n):
	(p, q) = map(int, input().split())
	for x in [q - 2, q - 1, q]:
		for y in [p - 2, p - 1, p]:
			if 1 <= y <= h - 2 and 1 <= x <= w - 2:
				d[x, y] += 1
cnt = Counter(d.values())
print((h - 2) * (w - 2) - sum(cnt.values()))
for i in range(1, 10):
	print(cnt[i])


(H, W, N) = map(int, input().split())
S = {}
for i in range(N):
	(a, b) = map(int, input().split())
	(a, b) = (a - 1, b - 1)
	for i in range(max(0, a - 1), min(H, a + 2)):
		for j in range(max(0, b - 1), min(W, b + 2)):
			if (i, j) not in S:
				S[i, j] = 0
			S[i, j] += 1
rs = [0] * 10
rs[0] = (H - 2) * (W - 2)
for (i, j) in S:
	if i > 0 and j > 0 and (i < H - 1) and (j < W - 1):
		n = S[i, j]
		rs[0] -= 1
		rs[n] += 1
for j in range(0, 9 + 1):
	r = rs[j]
	print(r)


import sys
from collections import Counter
sr = lambda : sys.stdin.readline().rstrip()
ir = lambda : int(sr())
lr = lambda : list(map(int, sr().split()))
(H, W, N) = lr()
pairs = []
for _ in range(N):
	(a, b) = lr()
	a -= 1
	b -= 1
	for dh in [-2, -1, 0]:
		if a + dh < 0 or a + dh > H - 3:
			continue
		for dw in [-2, -1, 0]:
			if b + dw < 0 or b + dw > W - 3:
				continue
			pairs.append((a + dh, b + dw))
counter = Counter(pairs)
answer = [0] * 10
counter2 = Counter(list(counter.values()))
for (k, v) in list(counter2.items()):
	answer[k] = v
answer[0] = (H - 2) * (W - 2) - sum(answer)
print('\n'.join(map(str, answer)))


from collections import defaultdict
from itertools import product
(h, w, n) = [int(i) for i in input().split()]
A = [[int(i) for i in input().split()] for j in range(n)]
board = defaultdict(int)
for (a, b) in A:
	for (dx, dy) in product((-1, 0, 1), repeat=2):
		board[a + dx, b + dy] += 1
ans = [0] * 10
ans[0] = (h - 2) * (w - 2)
for (k, v) in board.items():
	if 1 < k[0] < h and 1 < k[1] < w:
		ans[0] -= 1
		ans[v] += 1
for a in ans:
	print(a)


(H, W, N) = map(int, input().split())
Dic = {}
for i in range(N):
	(a, b) = map(int, input().split())
	for j in range(3):
		for k in range(3):
			if 1 <= a - j <= H - 2 and 1 <= b - k <= W - 2:
				if (a - j, b - k) in Dic:
					Dic[a - j, b - k] += 1
				else:
					Dic[a - j, b - k] = 1
Painted = [0 for _ in range(10)]
colered = 0
for i in Dic:
	Painted[Dic[i]] += 1
	colered += 1
Painted[0] = (H - 2) * (W - 2) - colered
for i in Painted:
	print(i)


from collections import Counter, defaultdict
from itertools import product
import sys
try:
	from typing import List
except ImportError:
	pass

def solve(H: int, W: int, N: int, a: 'List[int]', b: 'List[int]'):
	d = defaultdict(int)
	for (ai, bi) in zip(a, b):
		for (da, db) in product((-1, 0, 1), repeat=2):
			aj = ai - 1 + da
			bj = bi - 1 + db
			if 1 <= aj <= H - 2 and 1 <= bj <= W - 2:
				d[aj, bj] += 1
	c = Counter(list(d.values()))
	e = [c[i] for i in range(1, 10)]
	print((H - 2) * (W - 2) - sum(e))
	for ei in e:
		print(ei)

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	H = int(next(tokens))
	W = int(next(tokens))
	N = int(next(tokens))
	a = [int()] * N
	b = [int()] * N
	for i in range(N):
		a[i] = int(next(tokens))
		b[i] = int(next(tokens))
	solve(H, W, N, a, b)

def __starting_point():
	main()
__starting_point()


import sys
import numpy as np
sr = lambda : sys.stdin.readline().rstrip()
ir = lambda : int(sr())
lr = lambda : list(map(int, sr().split()))
(H, W, N) = lr()
shift = ((0, 0), (0, 1), (1, 0), (0, -1), (-1, 0), (1, 1), (-1, -1), (-1, 1), (1, -1))
l = []
for n in range(N):
	(a, b) = lr()
	for s in shift:
		aa = a + s[0] - 1
		bb = b + s[1] - 1
		if aa < 1 or aa > H - 2:
			continue
		if bb < 1 or bb > W - 2:
			continue
		l.append((aa - 1, bb - 1))
if len(l) == 0:
	print((H - 2) * (W - 2))
	[print(0) for _ in range(9)]
	return
l.sort()
m = {i: 0 for i in range(10)}
pre = l[0]
c = 1
for ll in l[1:]:
	if pre == ll:
		c += 1
	else:
		m[c] += 1
		pre = ll
		c = 1
m[c] += 1
m[0] = (H - 2) * (W - 2) - sum(m.values())
for v in m.values():
	print(v)


def main():
	from collections import defaultdict
	import sys
	input = sys.stdin.readline
	(H, W, N) = map(int, input().split())
	g = defaultdict(int)
	for _ in range(N):
		(a, b) = (int(x) - 1 for x in input().split())
		for i in range(3):
			if a - i < 0:
				continue
			if a - i + 3 > H:
				continue
			for j in range(3):
				if b - j < 0:
					continue
				if b - j + 3 > W:
					continue
				g[(a - i) * W + (b - j)] += 1
	ctr = [0] * 10
	tot = (H - 2) * (W - 2)
	for cnt in g.values():
		ctr[cnt] += 1
		tot -= 1
	ctr[0] = tot
	print(*ctr, sep='\n')

def __starting_point():
	main()
__starting_point()


import sys
from itertools import combinations
input = sys.stdin.readline

def main():
	(h, w, n) = list(map(int, input().split()))
	grid = [0] * n
	mod = 10 ** 9
	judge = dict()
	for _ in range(n):
		(a, b) = list(map(int, input().split()))
		for i in range(-1, 2):
			for j in range(-1, 2):
				if a + i <= 1 or a + i >= h or b + j <= 1 or (b + j >= w):
					continue
				if (a + i, b + j) in judge:
					judge[a + i, b + j] += 1
				else:
					judge[a + i, b + j] = 1
	ans = [0] * 10
	for v in list(judge.values()):
		ans[v] += 1
	ans[0] = (h - 2) * (w - 2) - sum(ans[1:])
	for a in ans:
		print(a)

def __starting_point():
	main()
__starting_point()


import numpy as np
from collections import Counter
(h, w, n) = map(int, input().split())
d = {}
for i in range(n):
	(a, b) = map(int, input().split())
	(a, b) = (a - 1, b - 1)
	am1_f = a - 1 > 0
	ap1_f = a + 1 < h - 1
	bm1_f = b - 1 > 0
	bp1_f = b + 1 < w - 1
	a_f = a > 0 and a < h - 1
	b_f = b > 0 and b < w - 1
	am1 = a - 1
	ap1 = a + 1
	bm1 = b - 1
	bp1 = b + 1
	if am1_f:
		baseid = am1 * w
		if b_f:
			pid = baseid + b
			if pid not in d:
				d[pid] = 1
			else:
				d[pid] += 1
		if bm1_f:
			pid = baseid + bm1
			if pid not in d:
				d[pid] = 1
			else:
				d[pid] += 1
		if bp1_f:
			pid = baseid + bp1
			if pid not in d:
				d[pid] = 1
			else:
				d[pid] += 1
	if ap1_f:
		baseid = ap1 * w
		if b_f:
			pid = baseid + b
			if pid not in d:
				d[pid] = 1
			else:
				d[pid] += 1
		if bm1_f:
			pid = baseid + bm1
			if pid not in d:
				d[pid] = 1
			else:
				d[pid] += 1
		if bp1_f:
			pid = baseid + bp1
			if pid not in d:
				d[pid] = 1
			else:
				d[pid] += 1
	if a_f:
		baseid = a * w
		if b_f:
			pid = baseid + b
			if pid not in d:
				d[pid] = 1
			else:
				d[pid] += 1
		if bm1_f:
			pid = baseid + bm1
			if pid not in d:
				d[pid] = 1
			else:
				d[pid] += 1
		if bp1_f:
			pid = baseid + bp1
			if pid not in d:
				d[pid] = 1
			else:
				d[pid] += 1
ans = [0 for i in range(10)]
for val in d.values():
	ans[val] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for a in ans:
	print(a)


def main():
	(h, w, n) = map(int, input().split())
	dic = {}
	for _ in range(n):
		(a, b) = map(int, input().split())
		for i in range(max(2, a - 1), min(h, a + 2)):
			for j in range(max(2, b - 1), min(w, b + 2)):
				if (i, j) in dic:
					dic[i, j] += 1
				else:
					dic[i, j] = 1
	ans = [0] * 10
	cnt = 0
	for v in dic.values():
		ans[v] += 1
		cnt += 1
	ans[0] = (h - 2) * (w - 2) - cnt
	for i in range(10):
		print(ans[i])

def __starting_point():
	main()
__starting_point()