CodeEff/ECCO huggingface dataset:
# Original solution
from collections import defaultdict
H,W,N = list(map(int,input().split()))
d = defaultdict(lambda:0)
ab = [tuple(map(int,input().split())) for _ in range(N)]
for i in range(N):
    d[ab[i]] = 1

ans = 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:
                n = 0
                for dx2 in [-1,0,1]:
                    for dy2 in [-1,0,1]:
                        n += d[(x+dx2,y+dy2)]
                ans[n] += 1

for i in range(N):
    count(*ab[i])

ans[0] = (H-2)*(W-2)
for i in range(1,10):
    ans[0] -= ans[i]//i
    ans[i] //= i

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

# Optimized solution
from collections import defaultdict
H,W,N = list(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]))
# Original solution
import sys

#sys.stdin = open('input1.txt', 'r')

H, W , N = list(map(int, input().split()))
squares = {}
results = [0 for _ in range(10)]
for _ in range(N):
	h, w = list(map(int, input().split()))
	for x in [(0, 0), (0, -1), (0, -2), (-1, 0), (-1, -1), (-1, -2), (-2, 0), (-2, -1), (-2, -2)]:
		nh, nw = h + x[0], w + x[1]
		if ((nh < 1) or (nw < 1) or (nh + 2 > H) or (nw + 2 > W)):
			pass
		else:
			if (nh, nw) in squares:
				squares[(nh, nw)] += 1
			else:
				squares[(nh, nw)] = 1

for k in list(squares.keys()):
	results[squares[k]] += 1

subtotal = 0
for x in range(1, 10, 1):
	subtotal += results[x]
results[0] = (H - 2) * (W - 2) - subtotal

for x in range(10):
	print(str(results[x]))


# Optimized solution
import sys

#sys.stdin = open('input1.txt', 'r')

H, W , N = list(map(int, input().split()))
squares = {}
results = [0 for _ in range(10)]
for _ in range(N):
	h, w = list(map(int, input().split()))
	for x in [(0, 0), (0, -1), (0, -2), (-1, 0), (-1, -1), (-1, -2), (-2, 0), (-2, -1), (-2, -2)]:
		nh, nw = h + x[0], w + x[1]
		if ((nh < 1) or (nw < 1) or (nh + 2 > H) or (nw + 2 > W)):
			pass
		else:
			if (nh, nw) in squares:
				squares[(nh, nw)] += 1
			else:
				squares[(nh, nw)] = 1

for v in list(squares.values()):
	results[v] += 1

subtotal = 0
for x in range(1, 10, 1):
	subtotal += results[x]
results[0] = (H - 2) * (W - 2) - subtotal

for x in range(10):
	print(str(results[x]))
# Original solution
import sys

#sys.stdin = open('input1.txt', 'r')

H, W , N = list(map(int, input().split()))
squares = {}
results = [0 for _ in range(10)]
for _ in range(N):
	h, w = list(map(int, input().split()))
	for x in [(0, 0), (0, -1), (0, -2), (-1, 0), (-1, -1), (-1, -2), (-2, 0), (-2, -1), (-2, -2)]:
		nh, nw = h + x[0], w + x[1]
		if ((nh < 1) or (nw < 1) or (nh + 2 > H) or (nw + 2 > W)):
			pass
		else:
			if (nh, nw) in squares:
				squares[(nh, nw)] += 1
			else:
				squares[(nh, nw)] = 1

for v in list(squares.values()):
	results[v] += 1

subtotal = 0
for x in range(1, 10, 1):
	subtotal += results[x]
results[0] = (H - 2) * (W - 2) - subtotal

for x in range(10):
	print(str(results[x]))


# Optimized solution
import sys

#sys.stdin = open('input1.txt', 'r')

H, W , N = list(map(int, input().split()))
squares = {}
results = [0 for _ in range(10)]
for _ in range(N):
	h, w = list(map(int, input().split()))
	for x in [(0, 0), (0, -1), (0, -2), (-1, 0), (-1, -1), (-1, -2), (-2, 0), (-2, -1), (-2, -2)]:
		nh, nw = h + x[0], w + x[1]
		if ((nh < 1) or (nw < 1) or (nh + 2 > H) or (nw + 2 > W)):
			pass
		else:
			if (nh, nw) in squares:
				squares[(nh, nw)] += 1
			else:
				squares[(nh, nw)] = 1

for v in list(squares.values()):
	results[v] += 1

results[0] = (H - 2) * (W - 2) - sum(results[1:])

for x in range(10):
	print(str(results[x]))
# Original solution
import bisect
from operator import itemgetter

h,w,n = list(map(int, input().split()))
# 黒マス
black = []

# 周囲に黒マスがあるマス
search = set()

for i in range(n):
    a,b = list(map(int, input().split()))
    a-=1
    b-=1
    black.append([a,b])
    for x in [-1,0,1]:
        for y in [-1,0,1]:
            if 1<=a+y<h-1 and 1<=b+x<w-1:
                search.add((a+y,b+x))  # タプル。set()内にリストは格納できない。

# 二分探索のためソート
black.sort(key=itemgetter(1))
black.sort(key=itemgetter(0))

ans = [0]*10
# 探索すべき全マスに対して、周囲の黒マスの数を数える。
for a,b in search:
    p = 0
    for y in [-1,0,1]:
        for x in [-1,0,1]:
            try:
                if [a+y,b+x]==black[bisect.bisect_left(black,[a+y,b+x])]:
                    p+=1
            except:
                continue
    ans[p]+=1
ans[0]=(h-2)*(w-2)-sum(ans[1:])

for a in ans:
    print(a)

# Optimized solution
h,w,n = list(map(int, input().split()))

# 黒マス black[y座標] = [x1,x2,...]
black = dict()

# 周囲に黒マスがあるマス
search = set()

for i in range(n):
    a,b = list(map(int, input().split()))
    a-=1
    b-=1
    for x in [-1,0,1]:
        for y in [-1,0,1]:
            if 1<=a+y<h-1 and 1<=b+x<w-1:
                search.add((a+y,b+x))  # タプル。set()内にリストは格納できない。
    try:
        black[a][b]=1
    except:
        black[a]=dict()
        black[a][b]=1


ans = [0]*10
# 探索すべき全マスに対して、周囲の黒マスの数を数える。
for a,b in search:
    p = 0
    for y in [-1,0,1]:
        for x in [-1,0,1]:
            try:
                if black[a+y][b+x]==1:
                    p+=1
            except:
                continue
    ans[p]+=1
ans[0]=(h-2)*(w-2)-sum(ans[1:])

for a in ans:
    print(a)
# Original solution
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")

  


# Optimized solution
H,W,N = list(map(int,input().split()))
B = set([])
for i in range(N):
  a,b = list(map(int,input().split()))
  a-=1;b-=1
  B.add((a,b))
#print(B)
BB = list(B)
ans = [0 for _ in range(10)]
for i in range(N):
  cnt = 0; temp = 0
  x,y = BB[i]
  #print(x,y)
  for sx in range(max(0,x-2),min(x,H-3)+1):
    for sy in range(max(0,y-2),min(y,W-3)+1):
      temp = 0
      for p in range(3):
        for q in range(3):
          if (sx+p,sy+q) in B:
            temp += 1
      #print(sx,sy,temp)
      ans[temp] += 1
for i in range(1,10):
  ans[i] = ans[i]//i
ans[0] = (H-2)*(W-2)-sum(ans[1:])
for t in ans:
  print(t)
# Original solution
import bisect
import heapq
H,W,N = list(map(int,input().split()))
P = list(list(map(int,input().split()))for i in range(N))
P.sort()

def index(a,x):
    i = bisect.bisect_left(a,x)
    if i != len(a) and a[i] == x:
        return 0
    return -1

def around(a,b):
    out = []
    for i in [-1,0,1]:
        if not 1 < a+i < H:
            continue
        for j in [-1,0,1]:
            if not 1 < b+j < W:
                continue
            out.append([a+i,b+j])
    return out



def search(a,b):
    hoge = 0
    for i in [-1,0,1]:
        for j in [-1,0,1]:
            x,y = a+i,b+j
            if index(P,[x,y]) != -1:
                hoge += 1
    return hoge

A = []
for a,b in P:
    for x,y in around(a,b):
        heapq.heappush(A,[search(x,y),x,y])
a,b = 0,0
ans = [0]*10

while A:
    a = heapq.heappop(A)
    if a != b:
        ans[a[0]] += 1
    b = a[:]

ans[0] = (H-2)*(W-2)-sum(ans[1:])

for i in ans:
    print(i)

# Optimized solution
import sys
input = sys.stdin.readline

H,W,N = list(map(int,input().split()))
A = []
for i in range(N):
    a,b = list(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)
# Original solution
import sys
input = sys.stdin.readline

lst = []
lst_append = lst.append
H, W, N = map(int, input().split())
tmplst = [-1, 0, 1]
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 1 <= a + i <= H - 2 and 1 <= b + j <= W - 2:
                lst_append((a + i, b + j))

lst.sort()
ans = [0] * 10
ans[0] = (H - 2) * (W - 2)

tmp = None
count = 0
for i in lst:
    if i == tmp:
        count += 1
    else:
        ans[0] -= 1
        ans[count] += 1
        count = 1
        tmp = i

ans[0] -= 1
ans[count] += 1
print (*ans, sep = '\n')


# Optimized solution
import sys
input = sys.stdin.readline

lst = []
lst_append = lst.append
H, W, N = map(int, input().split())
tmplst = [-1, 0, 1]
for _ in range(N):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    for i in tmplst:
        if 1 <= a + i <= H - 2:
            for j in tmplst:
                if 1 <= b + j <= W - 2:
                    lst_append((a + i, b + j))

lst.sort()
ans = [0] * 10
ans[0] = (H - 2) * (W - 2)

tmp = None
count = 0
for i in lst:
    if i == tmp:
        count += 1
    else:
        ans[0] -= 1
        ans[count] += 1
        count = 1
        tmp = i

ans[0] -= 1
ans[count] += 1
print (*ans, sep = '\n')
# Original solution
from collections import Counter
H,W,N = list(map(int,input().split()))
Bs = []
for i in range(N):
    x,y = list(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]))
    

# Optimized solution
H,W,N = list(map(int,input().split()))
dic = {}
for i in range(N):
    a,b = list(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 list(dic.keys()):
                    dic[(a-dh,b-dw)] = 1
                else:
                    dic[(a-dh,b-dw)] += 1

Ans = [0]*10
total = 0
for v in list(dic.values()):
    Ans[v] += 1
    total += 1

Ans[0] = (H-2)*(W-2) - total

for ans in Ans:
    print(ans)
# Original solution
# python3 (3.4.3)
import sys
input = sys.stdin.readline

# main
from collections import defaultdict
H,W,N = list(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 list(dic.values()):
    Ans[v] += 1
    total += 1

Ans[0] = (H-2)*(W-2) - total

for ans in Ans:
    print(ans)


# Optimized solution
# python3 (3.4.3)
import sys
input = sys.stdin.readline

# main
from collections import defaultdict
from collections import Counter
H,W,N = list(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 = Counter(list(dic.values()))
Ans[0] = (H-2)*(W-2) - sum(Ans.values())

for i in range(10):
    print((Ans[i]))
# Original solution
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]))


# Optimized solution
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]))
# Original solution
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]))


# Optimized solution
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]))
# Original solution
#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()))

"""
10010
00000
00000
00000
"""

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

    for idx1 in range(len(ab)):
        if ab[idx1][0] < 3:
            sr = 0
        else:
            sr = ab[idx1][0] - 3
        if ab[idx1][0] > h - 2:
            lr = h - 2
        else:
            lr = ab[idx1][0]

        if ab[idx1][1] < 3:
            sc = 0
        else:
            sc = ab[idx1][1] - 3
        if ab[idx1][1] > w - 2:
            lc = w - 2
        else:
            lc = ab[idx1][1]

        #print('s_Row:{} l_Row:{} s_Col:{} l_Col:{}'.format(sr, lr, sc, lc))
        for nowRow in range(sr, lr):
            for nowCol in range(sc, lc):
                #print('nowRow:{} nowCol:{}'.format(nowRow, nowCol))
                w_black = 0
                for idx2 in range(idx1):
                    if nowRow < ab[idx2][0] <= nowRow + 3 and nowCol < ab[idx2][1] <= nowCol + 3:
                        w_black += 1
                black_cnt[w_black]     -= 1
                black_cnt[w_black + 1] += 1
                #print(black_cnt)

for idx1 in range(len(black_cnt)):
    print((black_cnt[idx1]))


# Optimized solution
#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)
# Original solution
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)]
N = [0]*10
N[0] = (H-2)*(W-2)
# S[i]: set(黒いマスをi個こ含む3*3マスの中心セル)

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
    for i in range(10):
      if (X, Y) in S[i]:
        S[i].remove((X, Y))
        S[i+1].add((X, Y))
        N[i] -=1
        N[i+1] +=1
        break
    else:
      S[1].add((X, Y))
      N[1] +=1
      N[0] -=1

for n in N:
  print(n)

# Optimized solution
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)]
# S[i]: set(黒いマスをi個こ含む3*3マスの中心セル)

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
    for i in range(10):
      if (X, Y) in S[i]:
        S[i].remove((X, Y))
        S[i+1].add((X, Y))
        break
    else:
      S[1].add((X, Y))

L = [len(s) for s in S[1:]]
print(((H-2)*(W-2) - sum(L)))

for l in L:
  print(l)
# Original solution
h,w,n = list(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 list(c.items()):
    ans[itm[0]]=itm[1]

ans[0]=(h-2)*(w-2)-sum(ans)

for a in ans:
    print(a)

# Optimized solution
import sys
input=sys.stdin.readline
h,w,n = list(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 list(c.items()):
    ans[itm[0]]=itm[1]

ans[0]=(h-2)*(w-2)-sum(ans)

for a in ans:
    print(a)
# Original solution
from collections import defaultdict

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


# Optimized solution
from collections import defaultdict

h, w, n = list(map(int, input().split()))
d = defaultdict(int)
for i in range(n):
    a, b = list(map(int, input().split()))
    for k in range(max(1, a - 2), min(h - 2, a) + 1):
        for l in range(max(1, b - 2), min(w - 2, b) + 1):
            x = (k, l)
            d[x] += 1
ans = [0] * 10
for v in list(d.values()):
    ans[v] += 1
ans[0] = (h - 2) * (w - 2) - sum(ans[1:])
for i in range(10):
    print((ans[i]))
# Original solution
inp=input().split(" ")
H=int(inp[0])
W=int(inp[1])
N=int(inp[2])
square=[]
plot=[]
times=[0 for i in range(10)]
times[0]=(H-2)*(W-2)
from collections import defaultdict
count=defaultdict(lambda:0)
def check(a,b,square):
    for i in range(3):
        for j in range(3):
            if a-i>=0 and b-j>=0 and a+2-i<=H-1 and b+2-j<=W-1:
                square.append([a-i,b-j])
for i in range(N):
    plot.append(list(map(int,input().split(" "))))
    check(plot[i][0]-1,plot[i][1]-1,square)
for i in range(len(square)):
    count[str(square[i])]+=1
for i in list(count.values()):
    times[i]+=1
    times[0]-=1
for i in range(len(times)):
    print((times[i]))

# Optimized solution
inp=input().split(" ")
H=int(inp[0])
W=int(inp[1])
N=int(inp[2])
plot=[]
times=[0 for i in range(10)]
times[0]=(H-2)*(W-2)
from collections import defaultdict
count=defaultdict(lambda:0)
def check(a,b,count):
    for i in range(3):
        for j in range(3):
            if a-i>=0 and b-j>=0 and a+2-i<=H-1 and b+2-j<=W-1:
                count[str([a-i,b-j])]+=1
for i in range(N):
    plot.append(list(map(int,input().split(" "))))
    check(plot[i][0]-1,plot[i][1]-1,count)
for i in list(count.values()):
    times[i]+=1
    times[0]-=1
for i in range(len(times)):
    print((times[i]))