(defn input []
  (let [[N M] (->> (clojure.string/split (read-line) #"\s")
                (map #(Integer/parseInt %)))]
    (list N M
      (->> (repeatedly M read-line)
        (into []
          (comp (map #(clojure.string/split % #"\s"))
            (map (partial mapv #(Integer/parseInt %)))))))))

(defn CoutningRoads ^"[S" [[N M Rs]]
  (let [Array (short-array N (short 0))]
    (doseq [r Rs
            :let [[id1 id2] (map dec r)]]
      (do
        (->> (aget ^"[S" Array id1)
          inc
          short
          (aset ^"[S" Array id1))
        (->> (aget ^"[S" Array id2)
          inc
          short
          (aset ^"[S" Array id2))))
    Array))


(->> (input)
  CoutningRoads
  (map #(printf "%s\n" %))
  (apply str)
  print)