import Control.Monad
import qualified Data.IntMap as IM

type Map = IM.IntMap Int

get :: Int -> Map -> Int
get key m = case IM.lookup key m of
  Just x  -> x
  Nothing -> 0

set :: Int -> Int -> Map -> Map
set = IM.insert

solve :: [[Int]] -> Map -> Map
solve [] m = m
solve ([a, b]:rs) m = solve rs $ set a (ca + 1) $ set b (cb + 1) m
  where ca = get a m
        cb = get b m

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