
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector as V
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

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 <- V.replicateM m (r' >>= (\[a,b] -> return (a,b)))
    blocks  <- V.replicateM k (r' >>= (\[s,c] -> return (s,c)))
    let fm = IM.fromListWith (++) $ V.toList (V.map (second pure) $ friends V.++(V.map swap friends))
    let bm = IM.fromListWith (++) $ V.toList (V.map (second pure) $ blocks V.++(V.map swap blocks ))
    putStrLn $ unwords $ map (show . IS.size . suggestions fm bm) [1..n]


cluster :: IM.IntMap [Int] -> Int -> IS.IntSet
cluster mp p = case IM.lookup p mp of
    Nothing -> IS.singleton p
    Just ps -> IS.insert p $ foldr1 IS.union (map (\p' -> cluster (IM.delete p mp) p') ps)

friendsOf :: Int -> IM.IntMap [Int] -> IS.IntSet
friendsOf p mp = IS.fromList $ fromMaybe [] (IM.lookup p mp)

suggestions :: IM.IntMap [Int] -> IM.IntMap [Int] -> Int -> IS.IntSet
suggestions fs bs p = cluster fs p IS.\\ (IS.insert p $ cluster bs p `IS.union` friendsOf p fs)


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