Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

H, W , N = map(int, raw_input().split())
squares = {}
results = [0 for _ in range(10)]
for _ in range(N):
	h, w = map(int, raw_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 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])


Fixed submission:
import sys

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

H, W , N = map(int, raw_input().split())
squares = {}
results = [0 for _ in range(10)]
for _ in range(N):
	h, w = map(int, raw_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 squares.values():
	results[v] += 1

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

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

Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

H, W , N = map(int, raw_input().split())
squares = {}
results = [0 for _ in range(10)]
for _ in range(N):
	h, w = map(int, raw_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 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])


Fixed submission:
import sys

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

H, W , N = map(int, raw_input().split())
squares = {}
results = [0 for _ in range(10)]
for _ in range(N):
	h, w = map(int, raw_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 squares.values():
	results[v] += 1

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

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

Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

H, W , N = map(int, raw_input().split())
squares = []
results = [0 for _ in range(10)]
for _ in range(N):
	h, w = map(int, raw_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:
			squares.append((nh, nw))
squares.sort()

current = ()
count = 0
for s in squares:
	if s != current:
		results[count] = results[count] + 1
		current = s
		count = 1
	else:
		count = count + 1
results[count] = results[count] + 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])


Fixed submission:
import sys

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

H, W , N = map(int, raw_input().split())
squares = {}
results = [0 for _ in range(10)]
for _ in range(N):
	h, w = map(int, raw_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 squares.values():
	results[v] += 1

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

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

Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

H, W, N = map(int, raw_input().split())
points = []
for _ in range(N):
	a, b = map(int, raw_input().split())
	points.append((a,b))

searched = {}
for p in points:
	searched[p] = 0
results = {}
for x in range(10):
	results[x] = 0

def get_points(h, w):
	if ((h + 2 >  H) or (w + 2 > W) or (h < 1) or (w < 1)):
		return 0
	else:
		count = 0
		for x in range(3):
			for y in range(3):
				if ( (h + x, w + y) in searched ):
					if searched[(h + x, w + y)] == 0:
						count = count + 1
					else:
						return 0
		return count

def search_three_by_three_square(pt):
	h, w = pt[0], pt[1]
	possibles = [(h , w), (h - 1, w), (h - 2 , w), (h , w - 1), (h - 1, w - 1), (h - 2, w - 1), (h, w - 2), (h - 1, w - 2), (h - 2, w - 2)]

	for p in possibles:
		v = get_points(p[0], p[1])
		results[v] = results[v] + 1

	searched[pt] = 1

for p in points:
	search_three_by_three_square(p)

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


Fixed submission:
import sys

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

H, W , N = map(int, raw_input().split())
squares = {}
results = [0 for _ in range(10)]
for _ in range(N):
	h, w = map(int, raw_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 squares.values():
	results[v] += 1

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

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

Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

H, W, N = map(int, raw_input().split())
points = []
for _ in range(N):
	a, b = map(int, raw_input().split())
	points.append((a,b))

points.sort(key=lambda x:x[0])
searched = {}
for p in points:
	searched[p] = 0
results = {}
for x in range(10):
	results[x] = 0

def get_points(h, w):
	if ((h + 2 >  H) or (w + 2 > W) or (h < 1) or (w < 1)):
		return 0
	else:
		count = 0
		for x in range(3):
			for y in range(3):
				if ( (h + x, w + y) in searched ):
					if searched[(h + x, w + y)] == 0:
						count = count + 1
					else:
						return 0
		return count

def search_three_by_three_square(pt):
	h, w = pt[0], pt[1]
	results[get_points(h, w)] = results[get_points(h, w)] + 1
	results[get_points(h - 1, w)] = results[get_points(h - 1, w)] + 1
	results[get_points(h - 2, w)] = results[get_points(h - 2, w)] + 1

	results[get_points(h, w - 1)] = results[get_points(h, w - 1)] + 1
	results[get_points(h - 1, w - 1)] = results[get_points(h - 1, w - 1)] + 1
	results[get_points(h - 2, w - 1)] = results[get_points(h - 2, w - 1)] + 1

	results[get_points(h, w - 2)] = results[get_points(h, w - 2)] + 1
	results[get_points(h - 1, w - 2)] = results[get_points(h - 1, w - 2)] + 1
	results[get_points(h - 2, w - 2)] = results[get_points(h - 2, w - 2)] + 1

	searched[pt] = 1

for p in points:
	search_three_by_three_square(p)

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


Fixed submission:
import sys

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

H, W , N = map(int, raw_input().split())
squares = {}
results = [0 for _ in range(10)]
for _ in range(N):
	h, w = map(int, raw_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 squares.values():
	results[v] += 1

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

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