#!/bin/sh
export LC_ALL=C
read w h n
awk -vw=$((w-1)) -vh=$((h-1)) '
{
	s=$1<3?2:$1-1
	t=w<$1+1?w:$1+1
	u=$2<3?2:$2-1
	v=h<$2+1?h:$2+1
	for(i=s;i<=t;i++)for(j=u;j<=v;j++)a[i,j]++
}
END{
	for(i in a)b[a[i]]++
	for(i=1;i<=9;i++){printf "-%d",b[i]|"eval echo \$\(\("(w-1)"*"(h-1)"`cat`\)\)";printf"%d\n",b[i]}
}
'|cat