import Control.Monad
import qualified Data.IntMap as IM
import Data.Maybe

type Map = IM.IntMap Integer

get :: Int -> Map -> Integer
get key m = fromMaybe 0 $ IM.lookup key m

solve :: [[Int]] -> Map -> Map
solve [] m = m
solve ([a, b]:rs) m = solve rs $ IM.insertWithKey f a 1 $ IM.insertWithKey f b 1 m
  where f _ new old = old + new

main :: IO ()
main = do
  [n, m] <- map read . words <$> getLine
  rows <- replicateM m $ map read . words <$> getLine
  let im = solve rows IM.empty
  mapM_ print $ (`get` im) <$> [1..n]