{-# LANGUAGE TupleSections #-}

import Control.Monad
import Data.Array.Unboxed
import qualified Data.ByteString.Char8 as C
import qualified Data.Map.Strict as M
import Data.Maybe

main = sol . fmap get . C.lines <$> C.getContents >>= put

get = fmap (fst . fromJust . C.readInt) . C.words

put = mapM_ print

sol ([h,w,n]:ps) = if n>0 then s:elems sm else (h-2)*(w-2):replicate 10 0
  where
  m = M.fromListWith (+) $ zip
    (concatMap (\[a,b] -> range ((a-1,b-1),(a+1,b+1))) ps)
    (repeat 1) :: M.Map (Int, Int) Int
  ks = filter (\(a,b) -> 1<a && a<h && 1<b && b<w) $ M.keys m
  sm = accumArray (+) 0 (1,9) $ (,1) . (m M.!) <$> ks :: UArray Int Int
  s = (h-2)*(w-2) - length ks
