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: interview

Starter code:

Solutions:
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 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 sys
input = sys.stdin.readline
# sys.setrecursionlimit(10 ** 9)
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')
    



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

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)


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
            #ここで起点(左上)nowx, nowy として　 9マスに着目する
            name = str(nowx) + ' '  +str(nowy)
            try: cand[name] += 1
            except: 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)


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


#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter, deque
import itertools
#from scipy.misc import comb

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

from itertools import product
from collections import Counter

H, W, N = map(int, input().split())
AB = [tuple(map(int, input().split())) for _ in range(N)]
D = tuple(product((-1, 0, 1), repeat=2))

cnt = Counter()
for a, b in AB:
    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')


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]

from collections import defaultdict
from collections import Counter

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

# 3*3マスの処理用リスト
dir = [[0, 0], [1, 0], [1, 1], [0, 1], [-1, 1],
       [-1, 0], [-1, -1], [0, -1], [1, -1]]

# そのマスを中心とする3*3グリッドに含まれる黒マスの数
dict = defaultdict(int)

for i in range(N):
    a, b = list(map(int, input().split()))
    for dy, dx in dir:
        # 3*3グリッドは、H*Wの中に完全に含まれていなければならないことに注意
        if 2 <= a + dy <= H - 1 and 2 <= b + dx <= W - 1:
            dict[(a + dy, b + dx)] += 1

c = Counter(list(dict.values()))
ans = [0 for _ in range(10)]

# ans[1], ans[2], ..., ans[9]を確定させる（ans[0]は後述）
for k, v in list(c.items()):
    if v > 0:
        ans[k] = v

# 全体で作れる3*3グリッドは(H-2)*(W-2)個
# ans[1],...,ans[9]の総和を引くとans[0]になる
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])

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


h,w,n=map(int,input().split());I=[list(map(int,input().split()))for i in[0]*n]
from itertools import product as p;from collections import Counter as c;ans=[0]*9;o=(h-2)*(w-2)
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;o-=v
print(o,*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:#for every paint
    cord = list(item)
#    print("----{},{}----".format(cord[0],cord[1]))
    #update candidate
    upcand = []#max9
    for i in range(cord[0]-1,cord[0]+2):
        for j in range(cord[1]-1,cord[1]+2):
#            print("----({},{})----".format(i,j))
            upcand.append([i,j])
#    print(upcand)
    for cand in upcand:
#        print(cand)
        if 1 < cand[0] < h and 1 < cand[1] < w:
#            print(cand)
            dict[(cand[0],cand[1])] = dict.get((cand[0],cand[1]), 0) + 1
#        print(dict)
for v in list(dict.values()):
    ans[v] += 1
    ans[0] -= 1

for i in ans:
    print(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)

#!/usr/bin/env python3
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))  # type: int
    W = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    a = [int()] * (N)  # type: "List[int]"
    b = [int()] * (N)  # type: "List[int]"
    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()

# solution
import io
from collections import Counter

nim, mike, kite, *AB = list(map(int, open(0).read().split()))

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

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

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

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


from collections import defaultdict
from itertools import product

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

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

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

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

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

for v in values:
    print(v)


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

import sys

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


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

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

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

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


def __starting_point():
    resolve()

__starting_point()

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 = list(map(int, input().split()))
square = dict()
for i in range(n):
    a, b = list(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 list(square.values()):
    ans[i] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans)
for i in range(10):
    print((ans[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)
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")

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))))
# 30


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

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

import sys
from collections import defaultdict,Counter

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

H,W,N = 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())
##print(num)
num[0] = (H-2)*(W-2)-sum(num.values())

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

#!/usr/bin/env python3
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))  # type: int
    W = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    a = [int()] * (N)  # type: "List[int]"
    b = [int()] * (N)  # type: "List[int]"
    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


def main():
    H, W, N = list(map(int, input().split(' ')))
    coord_list = [list(map(int, input().split(' '))) for _ in range(N)]
    # count squares (key: coord of top left cell, value: number of appearance)
    square_count = defaultdict(int)
    for coord in coord_list:
        coord = tuple(coord)
        # black cell is located on the top row
        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
        # black cell is located in the middle row
        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
        # black cell is located on the bottom row
        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
    # remove duplicated counts
    count = defaultdict(int)  # key: number of black cells, value: number of squares
    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
    # print answer
    for c in range(0, 10):
        print((count[c]))


def __starting_point():
    main()

__starting_point()

#すぬけくんの塗り絵
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
from collections import Counter

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

# 3*3マスの処理用リスト
dir = [[0, 0], [1, 0], [1, 1], [0, 1], [-1, 1],
       [-1, 0], [-1, -1], [0, -1], [1, -1]]

# そのマスを中心とする3*3グリッドに含まれる黒マスの数
dict = defaultdict(int)

for i in range(N):
    a, b = list(map(int, input().split()))
    for dy, dx in dir:
        # 3*3グリッドは、H*Wの中に完全に含まれていなければならないことに注意
        if 2 <= a + dy <= H - 1 and 2 <= b + dx <= W - 1:
            dict[(a + dy, b + dx)] += 1

c = Counter(list(dict.values()))
ans = [0 for _ in range(10)]

# ans[1], ans[2], ..., ans[9]を確定させる（ans[0]は後述）
for k, v in list(c.items()):
    if v > 0:
        ans[k] = v

# 全体で作れる3*3グリッドは(H-2)*(W-2)個
# ans[1],...,ans[9]の総和を引くとans[0]になる
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])

for i in range(10):
    print((ans[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))

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

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());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())
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])

from collections import defaultdict, Counter

h, w, n = list(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(list(d.values()))

print(((h - 2) * (w - 2) - sum(c.values())))

for i in range(1, 10):
    print((c[i]))


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

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

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

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


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

from collections import defaultdict
from collections import Counter

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

# 3*3マスの処理用リスト
dir = [[0, 0], [1, 0], [1, 1], [0, 1], [-1, 1],
       [-1, 0], [-1, -1], [0, -1], [1, -1]]

# そのマスを中心とする3*3グリッドに含まれる黒マスの数
dict = defaultdict(int)

for i in range(N):
    a, b = list(map(int, input().split()))
    for dy, dx in dir:
        # 3*3グリッドは、H*Wの中に完全に含まれていなければならないことに注意
        if 2 <= a + dy <= H - 1 and 2 <= b + dx <= W - 1:
            dict[(a + dy, b + dx)] += 1

c = Counter(list(dict.values()))
ans = [0 for _ in range(10)]

# ans[1], ans[2], ..., ans[9]を確定させる（ans[0]は後述）
for k, v in list(c.items()):
    if v > 0:
        ans[k] = v

# 全体で作れる3*3グリッドは(H-2)*(W-2)個
# ans[1],...,ans[9]の総和を引くとans[0]になる
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])

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


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
            #ここで起点(左上)nowx, nowy として　 9マスに着目する
            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)


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))
#print(abset)

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
#print(memo)  

case_list=[0]*10
for v in memo.values():
  case_list[v]+=1
case_list[0]=allcase-sum(case_list[1:])
#print(case_list)

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

def main():
    H, W, N = list(map(int, input().split()))
    C = {}
    for _ in range(N):
        a, b = list(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=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])

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

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

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)
#print(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])

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

# 黒いマスからスタートして右下の3 * ３グリッドマスにたどり着きたい場合はこう！
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

# print(d)
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)


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
            #ここで起点(左上)nowx, nowy として　 9マスに着目する
            name = str(nowx) + 'sakoda'  +str(nowy)
            try: cand[name] += 1
            except: 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)


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) #3*3正方形を左上のマスの座標で区別。値は正方形内の黒塗りの個数
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 #Sqの更新
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())
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')

import sys

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


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

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

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

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


def __starting_point():
    resolve()

__starting_point()

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
            #ここで起点(左上)nowx, nowy として　 9マスに着目する
            name = str(nowx) +"hoge" +str(nowy)
            try: cand[name] += 1
            except: 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)


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
#print(A)
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")

  

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


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

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-3 and 0 <= y <= w-3):
                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])

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

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

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)
            d.append(t)
d.sort()
l=[0]*10
t=0
c=0
for i in d:
    if i==t:
        c+=1
    else:
        l[c]+=1
        t=i
        c=1
l[c]+=1
l[0]=(H-2)*(W-2)-sum(l)+1
print(*l,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:#for every paint
    cord = list(item)
#    print("----{},{}----".format(cord[0],cord[1]))
    #update candidate
    upcand = []#max9
    for i in range(cord[0]-1,cord[0]+2):
        for j in range(cord[1]-1,cord[1]+2):
#            print("----({},{})----".format(i,j))
            upcand.append([i,j])
#    print(upcand)
    for cand in upcand:
#        print(cand)
        if 1 < cand[0] < h and 1 < cand[1] < w:
#            print(cand)
            dict[(cand[0],cand[1])] = dict.get((cand[0],cand[1]), 0) + 1
#        print(dict)
for k,v in list(dict.items()):
    ans[v] += 1
    ans[0] -= 1

for i in ans:
    print(i)


#in1 = '4 5 8'
#in2 = ['1 1', '1 4', '1 5', '2 3', '3 1', '3 2', '3 4', '4 4']
#in1 = '10 10 20'
#in2 = ['1 1', '1 4', '1 9', '2 5', '3 10', '4 2', '4 7', '5 9', '6 4', '6 6', '6 7', '7 1', '7 3', '7 7', '8 1', '8 5', '8 10', '9 2', '10 4', '10 9']
#in1 = '1000000000 1000000000 0'
#h, w, n = map(int, in1.split())
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()
        #x = in2[idx1].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)


h,w,n=list(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]))


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


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()))
#print(s)
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]
#    print(memo[i],count)

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


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
    # print(d)

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)

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)


from collections import defaultdict
from collections import Counter

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

# 3*3マスの処理用リスト
dir = [[0, 0], [1, 0], [1, 1], [0, 1], [-1, 1],
       [-1, 0], [-1, -1], [0, -1], [1, -1]]

# そのマスを中心とする3*3グリッドに含まれる黒マスの数
dict = defaultdict(int)

for i in range(N):
    a, b = list(map(int, input().split()))
    for dy, dx in dir:
        # 3*3グリッドは、H*Wの中に完全に含まれていなければならないことに注意
        if 2 <= a + dy <= H - 1 and 2 <= b + dx <= W - 1:
            dict[(a + dy, b + dx)] += 1

c = Counter(list(dict.values()))
ans = [0 for _ in range(10)]

# ans[1], ans[2], ..., ans[9]を確定させる（ans[0]は後述）
for k, v in list(c.items()):
    if v > 0:
        ans[k] = v

# 全体で作れる3*3グリッドは(H-2)*(W-2)個
# ans[1],...,ans[9]の総和を引くとans[0]になる
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])

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


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()))
    matrix.append([x-1,y-1])
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
            #ここで起点(左上)nowx, nowy として　 9マスに着目する
            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
ans[0] =tmp - len(cand)
for x in ans:
    print(x)


import sys
readline = sys.stdin.readline

H,W,N = list(map(int,readline().split()))
from collections import defaultdict

# 9x9のマスの左上のマスの座標をキーにして、各正方形の黒マス数をdictionaryで管理
# 10 ** 5 * 9程度

dic = defaultdict(int)

for i in range(N):
  a,b = list(map(int,readline().split()))
  a,b = a - 1,b - 1
  for A in range(max(0,a - 2), min(a + 1,H - 2)):
    for B in range(max(0,b - 2), min(b + 1,W - 2)):
      dic[(A,B)] += 1

ans = [0] * 10
for v in list(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 = list(map(int, input().split()))

# 3*3マスの処理用リスト
dir = [[0, 0], [1, 0], [1, 1], [0, 1], [-1, 1],
       [-1, 0], [-1, -1], [0, -1], [1, -1]]

# そのマスを中心とする3*3グリッドに含まれる黒マスの数
dict = {}

for i in range(N):
    a, b = list(map(int, input().split()))
    for dy, dx in dir:
        # 3*3グリッドは、H*Wの中に完全に含まれていなければならないことに注意
        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)]

# ans[1], ans[2], ..., ans[9]を確定させる（ans[0]は後述）
for k, v in list(c.items()):
    if v > 0:
        ans[k] = v

# 全体で作れる3*3グリッドは(H-2)*(W-2)個
# ans[1],...,ans[9]の総和を引くとans[0]になる
ans[0] = (H - 2) * (W - 2) - sum(ans[1:])

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


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") 
    #print(C)

    return 0

def __starting_point():
    solve()
__starting_point()

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
                # (a,b)を塗ったとき影響される3x3マス目の左上の座標に加算する

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

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


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, *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)))

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]
    #print(xw,yw)
    if 1 <= xw <= H-2 and 1 <= yw <= W-2:
      PaintList.append((xw,yw))

c = collections.Counter(PaintList)
#print(c)
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])

import sys

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


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

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

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

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


def __starting_point():
    resolve()

__starting_point()

H, W, N = map(int, input().split())
from collections import defaultdict as dd
Grid =  dd(lambda:0) #3*3正方形を左上のマスで区別。値は正方形内の黒塗りの個数
Draw = 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 _ in range(N):
    a, b = map(int, input().split())
    for x,y in Draw(a-1,b-1): #Gridの更新
        Grid[x,y] += 1
Ans = [(H-2)*(W-2)-len(Grid) if i == 0 else sum(v==i for v in Grid.values()) for i in range(10)]         
for ans in Ans:
    print(ans)

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

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])
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
            #ここで起点(左上)nowx, nowy として　 9マスに着目する
            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)


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)





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

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

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

import sys
readline = sys.stdin.readline

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

# 9x9のマスの左上のマスの座標をキーにして、各正方形の黒マス数をdictionaryで管理
# 10 ** 5 * 9程度

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)

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))
#        print(coor,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)



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) 
    



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


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)