{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
import Control.Applicative
import Control.Monad
import Data.List
import qualified Data.Map as MP
import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust)

readInts = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

includingBoxes h w [a, b] = (,) <$> range h a <*> range w b
    where range max = filter (cond max) . sequence ((+) <$> [-2..0])
          cond max  = (&&) <$> (>= 0) <*> (<= max - 3)

frequency :: Ord a => [a] -> [(a, Int)]
frequency = MP.toList . MP.fromListWith (+) . map (, 1)

solve h w ls = find <$> [0..9]
    where boxes    = ls >>= includingBoxes h w
          boxFreqs = frequency boxes
          freqs    = frequency . filter (<= 9) . map snd $ boxFreqs
          zeros    = (h - 2) * (w - 2) - length boxFreqs
          find v   = MP.findWithDefault 0 v $ MP.fromList $ (0, zeros):freqs

main = do
    [h, w, n] <- map read . words <$> getLine
    ls        <- replicateM n $ map pred <$> readInts
    mapM print $ solve h w ls
