import Control.Monad
import Control.Monad.ST
import Data.Array.ST
import qualified Data.ByteString.Char8 as C
import Data.IntMap.Strict (fromList, (!))
import Data.List
import qualified Data.Set as S

main = sub <$> get >>= put

get = fmap (unfoldr (C.readInt . C.dropWhile (==' '))) . C.lines <$> C.getContents

put = putStrLn . unwords . fmap show

sub ([n,m,k]:as) = sol n (splitAt m as)

sol n (es,bs) = fmap f [1..n]
  where
  rs = runST $ do
    uf <- newUF n
    forM_ es (unionUF uf) 
    rs <- mapM (findUF uf) [1..n]
    return $ fromList $ zip [1..] rs
  se = S.fromList $ pair <$> es
  sb = S.fromList $ pair <$> bs
  f i = length [1 | j <- [1..n], j/=i, rs!i==rs!j, 
    (pair [i,j]) `S.notMember` se, (pair [i,j]) `S.notMember` sb]

pair [a,b] = (min a b, max a b)