import qualified Data.Vector.Unboxed as U
import qualified Data.ByteString.Char8 as C
import Data.List
import Control.Monad
import Control.Arrow
import qualified Data.IntMap as IM
import qualified Data.IntSet as IS
import Data.Maybe
import Data.Graph

r :: Int -> IO (U.Vector Int)
r n = U.unfoldrN n (C.readInt . C.dropWhile (==' ')) <$> C.getLine

r' :: IO [Int]
r'  =   unfoldr    (C.readInt . C.dropWhile (==' ')) <$> C.getLine

main :: IO ()
main = do
    [n,m,k] <- r' :: IO [Int]
    friends <- replicateM m (r' >>= (\[a,b] -> return (a,b)))
    blocks  <- replicateM k (r' >>= (\[s,c] -> return (s,c)))

    let fs = friends ++ map swap friends
    let bs = blocks  ++ map swap blocks

    let fg = buildG (1,n) fs

    let fm = IM.fromListWith (++) $ map (second pure) fs
    let bm = IM.fromListWith (++) $ map (second pure) bs

    let net = Net n fg fm bm

    putStrLn $ unwords $ map (show .solve net) [1..n]


data Network = Net {population :: Int
    , friendGraph :: Graph
    , friendMap :: IM.IntMap [Int]
    , blockMap :: IM.IntMap [Int]}

solve net me = IS.size $ IS.fromList (reachable (friendGraph net) me) IS.\\
    (IS.fromList [me] `IS.union` IS.fromList (IM.findWithDefault [] me (friendMap net)) `IS.union` IS.fromList (IM.findWithDefault [] me (blockMap net)))

swap (a,b) = (b,a)

