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

RD = list(list(map(int, input().split())) for _ in range(m))

for i in range(1, n + 1):

    ans = 0

    for j in RD:

        ans += j.count(i)

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

NRD = list(0 for i in range(n))

for i in range(m):

    r1, r2 = list(map(int, input().split()))

    NRD[r1 - 1] += 1

    NRD[r2 - 1] += 1

for i in range(n):

    print((NRD[i]))
n, m = list(map(int, input().split()))
RD = list(list(map(int, input().split())) for _ in range(m))
for i in range(1, n + 1):
    ans = 0
    for j in RD:
        ans += j.count(i)
    print(ans)

n, m = list(map(int, input().split()))
NRD = list(0 for i in range(n))
for i in range(m):
    r1, r2 = list(map(int, input().split()))
    NRD[r1 - 1] += 1
    NRD[r2 - 1] += 1
for i in range(n):
    print((NRD[i]))

-RD = list(list(map(int, input().split())) for _ in range(m)) -for i in range(1, n + 1): -    ans = 0 -    for j in RD: -        ans += j.count(i) -    print(ans) +NRD = list(0 for i in range(n)) +for i in range(m): +    r1, r2 = list(map(int, input().split())) +    NRD[r1 - 1] += 1 +    NRD[r2 - 1] += 1 +for i in range(n): +    print((NRD[i]))