{-# LANGUAGE TupleSections #-}
import Control.Applicative
import Control.Monad
import Data.List
import qualified Data.IntMap 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] = [w * x + y |
                            x <- [a - 2, a - 1, a], x >= 0, x <= h - 3,
                            y <- [b - 2, b - 1, b], y >= 0, y <= w - 3]

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
