let rec read t m =
  if m = 0 then ()
  else
    begin
      let i, j = Scanf.scanf "%d %d\n" (fun x y -> (x, y)) in
      t.(i-1) <- t.(i-1) + 1;
      t.(j-1) <- t.(j-1) + 1;
      read t (m-1)
    end
         
let () =
  let n, m = Scanf.scanf "%d %d\n" (fun x y -> (x, y)) in
  let tbl = Array.make n 0 in
  read tbl m;
  Array.iter (fun v ->
              Printf.printf "%d\n" v
             ) tbl
