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)

-- | Union-Find
data UnionFind s = UnionFind {ids:: STUArray s Int Int, szs:: STUArray s Int Int}

newUF :: Int -> ST s (UnionFind s)
newUF n = liftM2 UnionFind (newListArray (1,n) [1..n]) (newArray (1,n) 1)

findUF :: UnionFind s -> Int -> ST s Int
findUF uf i = do
  ix <- readArray (ids uf) i
  if ix == i
    then return i
    else do
      writeArray (ids uf) i =<< readArray (ids uf) ix
      findUF uf ix

unionUF :: UnionFind s -> [Int] -> ST s ()
unionUF uf [p,q] = do
  i <- findUF uf p
  j <- findUF uf q
  szi <- readArray (szs uf) i
  szj <- readArray (szs uf) j
  if szi < szj
    then do
      writeArray (ids uf) i j
      writeArray (szs uf) j (szi+szj)
      writeArray (szs uf) i 0
    else do
      writeArray (ids uf) j i
      writeArray (szs uf) i (szj+szi)
      writeArray (szs uf) j 0