import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Unboxed.Mutable as UM
import qualified Data.ByteString.Char8 as C
import Data.List
import Control.Monad

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


type UF = (Parent,Rank,Size)
type Parent = UM.IOVector Int
type Rank   = UM.IOVector Int
type Size   = UM.IOVector Int

makeset :: Int -> IO UF
makeset n = do
    par <- U.thaw (U.generate n id)
    rnk <- UM.replicate n 0
    siz <- UM.replicate n 1
    return (par,rnk,siz)

root :: UF -> Int -> IO Int
root uf@(par,rnk,_) n = do
    x <- UM.read par n
    if x == n then return x else do
        nr <- root uf x
        UM.write par n nr
        UM.write rnk n 1
        return nr

same :: UF -> Int -> Int -> IO Bool
same uf x y = do
    rx <- root uf x
    ry <- root uf y
    return (rx == ry)

size :: UF -> Int -> IO Int
size uf@(par,rnk,siz) x = do
    r <- root uf x
    UM.read siz r

unite :: UF -> Int -> Int -> IO ()
unite uf@(par,rnk,siz) x y = do
    b <- same uf x y
    when (not b) $ do
        tx <- root uf x
        ty <- root uf y        
        rx <- UM.read rnk tx
        ry <- UM.read rnk ty
        sx <- size uf tx
        sy <- size uf ty
        if rx < ry then UM.write par tx ty >> UM.modify siz (+sx) ty
        else UM.write par ty tx >> when (rx == ry) (UM.modify rnk succ tx) >> UM.modify siz (+sy) tx


main :: IO ()
main = do
    [n,m,k] <- r'

    uf <- makeset n
    cnt <- UM.replicate n 0

    replicateM_ m $ do
        [a,b] <- map pred <$> r'
        unite uf a b
        UM.modify cnt succ a
        UM.modify cnt succ b
    replicateM_ k $ do
        [c,d] <- map pred <$> r'
        b <- same uf c d
        when b $ do
            UM.modify cnt succ c
            UM.modify cnt succ d

    putStrLn =<< unwords <$> mapM (\i -> do
        s <- size uf i
        c <- UM.read cnt i
        return $ show (s-c-1)
        ) [0..n-1]