import Prelude hiding (abs)
import Control.Monad
import Control.Arrow ((&&&))
import Data.List (nub, sort, group)
import Data.Maybe (fromMaybe)
import qualified Data.IntMap as M

type RoadCount = M.IntMap Int

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

-- |
--
-- >>> solve 4 [(1,2),(2,3),(1,4)]
-- [2,2,1,1]
--
-- >>> solve 2 [(1,2),(2,1),(1,2),(2,1),(1,2)]
-- [5,5]
--
-- >>> solve 8 [(1,2),(3,4),(1,5),(2,8),(3,7),(5,2),(4,1),(6,8)]
-- [3,3,2,2,2,1,1,2]
solve :: Int -> [(Int,Int)] -> [Int]
solve n abs = map (getRoads m) [1 .. n]
  where
    (as, bs) = unzip abs
    xss = group . sort $ as ++ bs
    road_count = map (head &&& length) xss
    m = M.fromList road_count

getRoads :: RoadCount -> Int -> Int
getRoads m x = fromMaybe 0 $ M.lookup x m

readLine2 :: String -> (Int,Int)
readLine2 = tuplify2 . map read . words
    where
      tuplify2 [] = (0, 0)
      tuplify2 [x] = (x, 0)
      tuplify2 (x:y:_) = (x, y)
