Scanf.scanf "%d %d" (fun n m ->
    let num = Array.make (n + 1) 0 in
    for i = 1 to m do
        Scanf.scanf " %d %d" (fun a b ->
            num.(a) <- num.(a) + 1;
            num.(b) <- num.(b) + 1;
        )
    done;
    for i = 1 to n do
        Printf.printf "%d\n" num.(i)
    done
)