n,m = list(map(int, input().split()))

adj = [[] for i in range(n)]

for i in range(m):

    a,b = list(map(int, input().split()))

    a-=1

    b-=1

    adj[a].append(b)

    adj[b].append(a)

for i in adj:

    print((len(i)))
N,M = (int(x) for x in input().split())



result = [0]*N

for i in range(M):

	a,b = (int(x) for x in input().split())

	result[a-1] += 1

	result[b-1] += 1



for i in result:

	print(i)
n, m = list(map(int, input().split()))
adj = [[] for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    adj[a].append(b)
    adj[b].append(a)
for i in adj:
    print((len(i)))

N, M = (int(x) for x in input().split())
result = [0] * N
for i in range(M):
    a, b = (int(x) for x in input().split())
    result[a - 1] += 1
    result[b - 1] += 1
for i in result:
    print(i)

-n, m = list(map(int, input().split())) -adj = [[] for i in range(n)] -for i in range(m): -    a, b = list(map(int, input().split())) -    a -= 1 -    b -= 1 -    adj[a].append(b) -    adj[b].append(a) -for i in adj: -    print((len(i))) +N, M = (int(x) for x in input().split()) +result = [0] * N +for i in range(M): +    a, b = (int(x) for x in input().split()) +    result[a - 1] += 1 +    result[b - 1] += 1 +for i in result: +    print(i)