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 cm = IM.fromList $ map (id &&& (IS.fromList.reachable fg)) [1..n]
    let fm = IM.map IS.fromList $ IM.fromListWith (++) $ map (second pure) fs
    let bm = IM.map IS.fromList $ IM.fromListWith (++) $ map (second pure) bs

    let net = Net n cm fm bm

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


data Network = Net {population :: Int
    , componentMap :: IM.IntMap IS.IntSet
    , friendMap :: IM.IntMap IS.IntSet
    , blockMap :: IM.IntMap IS.IntSet}

solve net me =
    let c = componentMap net IM.! me
        f = IM.findWithDefault IS.empty me (friendMap net)
        b = IM.findWithDefault IS.empty me (blockMap net)
    in
    IS.size c - (1 + IS.size (IS.filter (uncurry (||) . ((`IS.member` b) &&& (`IS.member` f))) c) )

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

