import           Control.Monad
import           Control.Monad.Primitive
import           Data.Bits
import qualified Data.ByteString.Char8       as BS
import           Data.List
import           Data.Maybe
import qualified Data.Vector                 as VB
import qualified Data.Vector.Mutable         as VBM
import qualified Data.Vector.Unboxed.Mutable as VM

import           Debug.Trace


newUF :: PrimMonad m => Int -> m (VM.MVector (PrimState m) Int)
newUF n = do
  d <- VM.new n
  VM.set d (-1)
  return d

findUF :: PrimMonad m => VM.MVector (PrimState m) Int -> Int -> m Int
findUF d x = do
  dx <- VM.read d x
  if dx < 0
    then return x
    else do dx' <- findUF d dx
            VM.write d x dx'
            return dx'

uniteUF :: PrimMonad m => VM.MVector (PrimState m) Int -> Int -> Int -> m ()
uniteUF d x y = do
  x' <- findUF d x
  y' <- findUF d y
  when (x' /= y') $ do
    let (x'', y'') = if (x' <= y') then (x', y') else (y', x')
    dx <- VM.read d x''
    dy <- VM.read d y''
    VM.write d x'' (dx + dy)
    VM.write d y'' x''
  return ()

sameUF :: PrimMonad m => VM.MVector (PrimState m) Int -> Int -> Int -> m Bool
sameUF d x y = do
  fx <- findUF d x
  fy <- findUF d y
  return $ fx == fy

sizeUF :: PrimMonad m => VM.MVector (PrimState m) Int -> Int -> m Int
sizeUF d x = do
  fx <- findUF d x
  dfx <- VM.read d fx
  return (-dfx)

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
  [n, m, k] <- getIntList
  fs <- replicateM m getIntList
  bs <- replicateM k getIntList

  blocks <- cnvBs n (fs++bs)

  uf <- newUF (n+1)

  forM_ fs $ \[a, b] -> do
    uniteUF uf a b

  forM_ [1..n] $ \i -> do
    when (i > 1) $ putStr " "
    printCand n i uf blocks

  putStrLn ""

  where
    cnvBs n bs = do
      blocks <- VBM.new (n+1)
      VBM.set blocks []
      forM_ bs $ \[c, d] -> do
        bc <- VBM.read blocks c
        bd <- VBM.read blocks d
        VBM.write blocks c (d:bc)
        VBM.write blocks d (c:bd)
      VB.freeze blocks

    printCand n i uf blocks = do
      t <- VM.new 1
      VM.set t (0::Int)
      forM_ [1..n] $ \j -> do
        same <- sameUF uf i j
        when (same && i /= j && (not (j `elem` (blocks VB.! i)))) $ do
          num <- VM.read t 0
          VM.write t 0 (num+1)
      num <- VM.read t 0
      putStr . show $ num