{-# LANGUAGE TupleSections #-}
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 :: [Int] -> [(Int, Int)]
frequency = MP.toList . MP.fromListWith (+) . map (, 1)

solve h w ls = find <$> [0..9]
  where
  boxFreqs = frequency $ includingBoxes h w =<< ls
  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
