There are N cities and M roads. The i-th road (1≤i≤M) connects two cities a_i and b_i (1≤a_i,b_i≤N) bidirectionally. There may be more than one road that connects the same pair of two cities. For each city, how many roads are connected to the city?
# ABC061B - Counting Roads
def main():
    N, M = tuple(map(int, input().split()))
    E = tuple(tuple(map(int, input().split())) for _ in range(M))
    G = [[] for _ in range(N + 1)]
    for v, u in E:
        G[v] += [u]
        G[u] += [v]
    print(*G[1:], sep="\n")


if __name__ == "__main__":
    main()
from collections import defaultdict


def main():
    N, M, *AB = map(int, open(0).read().split())
    cnt = defaultdict(int)
    for a, b in zip(*[iter(AB)] * 2):
        cnt[a] += 1
        cnt[b] += 1
    ans = []
    for i in range(1, N + 1):
        ans.append(cnt[i])
    print("\n".join(map(str, ans)))


if __name__ == "__main__":
    main()
