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?

-----Constraints-----
 - 2≤N,M≤50
 - 1≤a_i,b_i≤N
 - a_i ≠ b_i
 - All input values are integers.

-----Input-----
Input is given from Standard Input in the following format:  
N M
a_1 b_1
:  
a_M b_M

-----Output-----
Print the answer in N lines.
In the i-th line (1≤i≤N), print the number of roads connected to city i.

-----Sample Input-----
4 3
1 2
2 3
1 4

-----Sample Output-----
2
2
1
1

 - City 1 is connected to the 1-st and 3-rd roads.
 - City 2 is connected to the 1-st and 2-nd roads.
 - City 3 is connected to the 2-nd road.
 - City 4 is connected to the 3-rd road.

Difficulty: introductory

Starter code:

Solutions:
n,m = map(int, input().split())
c = [0 for _ in range(n)]
for i in range(m):
  a,b = map(int, input().split())
  c[a-1] += 1
  c[b-1] += 1
for j in range(n):
  print(c[j])

n,m = [int(x) for x in input().split()]
count = [0] * (n+1)
for i in range(m):
  a,b = [int(x) for x in input().split()]
  count[a] += 1
  count[b] += 1
for i in range(1,n+1):
  print(count[i])

#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main2():
    numbers=[]
    n,m = map(int,input().split())
    numbers=[list(map(int,input().split())) for _ in range(m)]
    dp=[0]*n
    for number in numbers:
        for n in number:
            dp[n-1]+=1
    for ans in dp:
        print(ans)

def main():
    numbers=[]
    n,m = map(int,input().split())
    numbers=[list(map(int,input().split())) for _ in range(m)]
    dp={}
    for number in numbers:
        for n in number:
            if n not in dp:
                dp[n]=1
            else:
                dp[n]+=1
    print(dp)
    for i in range(1,len(dp)+1):
        print(dp[i])

def __starting_point():
    main2()
__starting_point()

n,m = list(map(int, input().split()))
g = [[] for _ in range(n)]

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



n,m = map(int, input().split())
a = [0] * m
b = [0] * m
for i in range(m):
    a[i], b[i] = map(int, input().split())
for i in range(n):
    print((a+b).count(i+1))

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


n,m=map(int,input().split())
a=[]
for i in range(m):
    x,y=map(int,input().split())
    a.append(x)
    a.append(y)
for i in range(1,n+1):
    print(a.count(i))

n,m = map(int,input().split())
ans = []
for i in range(m):
    a,b = map(int,input().split())
    ans.append(a)
    ans.append(b)

for j in range(1,n+1):
    print(ans.count(j))

n,m=list(map(int,input().split()))
al=[]
bl=[]
for i in range(m):
  a,b=list(map(int,input().split()))
  al.append(a)
  bl.append(b)

for i in range(1,n+1):
  print((al.count(i)+bl.count(i)))


N, M = map(int, input().split())
road_list = []
for i in range(M):
  road_list.append(list(map(int, input().split())))

road_dict = {}
for road in road_list:
  first_city = road[0]
  second_city = road[1]
  first_city_road_list = road_dict.get(first_city, [])
  first_city_road_list.append(second_city)
  road_dict[first_city] = first_city_road_list
  
  second_city_road_list = road_dict.get(second_city, [])
  second_city_road_list.append(first_city)
  road_dict[second_city] = second_city_road_list

for i in range(1, N+1):
  city_road_list = road_dict.get(i, [])
  road_num = len(city_road_list) if city_road_list != [] else 0
  print(road_num)

n,m = map(int,input().split())
li1 = [0]*n
for i in range(m):
    a,b = map(int,input().split())
    li1[a-1] += 1
    li1[b-1] += 1
for i in range(n):
    print(li1[i])

n, m = list(map(int, input().split()))
counter_list = [0] * (n + 1)
for i in range(m):
    a, b = list(map(int, input().split()))
    counter_list[a] += 1
    counter_list[b] += 1

for i in range(1, n + 1):
    print((counter_list[i]))


n, m = map(int, input().split())
c = []
for _ in range(m):
    a, b = map(str, input().split())
    c.append(a)
    c.append(b)
for i in range(1, n + 1):
    print(c.count(str(i)))

N,M = list(map(int,input().split()))
L = [0] * (N+1)
for i in range(M):
  A,B = list(map(int,input().split()))
  L[A] += 1
  L[B] += 1
for j in range(1,N+1):
  print((L[j]))


n,m = map(int,input().split())
data = [input().split() for i in range(m)]
for i in range(1,n+1):
    count = 0
    for j in range(m):
        if int(data[j][0]) == i or int(data[j][1]) == i:
            count += 1
    print(count)

import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: list(map(int, sys.stdin.readline().split()))
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n, m = rm()
li = [[] for _ in range(n)]
for _ in range(m):
    a, b = rm()
    a -= 1
    b -= 1
    li[a].append(b)
    li[b].append(a)
for lis in li:
    print((len(lis)))















N, M = tuple(map(int, input().split()))

count_road = [0 for _ in range(N+1)]

for _ in range(M):
    a, b = tuple(map(int, input().split()))
    count_road[a] += 1
    count_road[b] += 1
    
for i in range(1, N+1):
    print(count_road[i])

n, m = list(map(int, input().split()))
arr = [0] * n

for _ in range(m):
    x, y = list(map(int, input().split()))
    arr[x - 1] += 1
    arr[y - 1] += 1

for ele in arr:
    print(ele)


N, M=map(int, input().split())
nums=[0]*(N+1)
for _ in range(M):
  a, b=map(int, input().split())
  nums[a]+=1
  nums[b]+=1
print(*nums[1:], sep='\n')

n, m = list(map(int, input().split()))
ans = [0]*n

for _ in range(m):
    a, b, = list(map(int, input().split()))
    ans[a-1] += 1
    ans[b-1] += 1

for i in range(n):
    print((ans[i]))


N, M = list(map(int, input().split()))
a_s = []
b_s = []
for i in range(M):
	a, b = list(map(int, input().split()))
	a_s.append(a)
	b_s.append(b)

for i in range(1, N + 1):
	print((a_s.count(i) + b_s.count(i)))


n, m = map(int, input().split())
num = []
for i in range(m):
    a, b = map(int, input().split())
    num.append(a)
    num.append(b)

for i in range(n):
    print(num.count(i + 1))

N,M = list(map(int,input().split()))
li = []
for _ in range(M):
  li += input().split()
for i in range(1,N+1):
  print((li.count(str(i))))


n, m = map(int, input().split())
l = []
for i in range(m):
	a,b = map(int, input().split())
	l.append(a)
	l.append(b)
for i in range(n):
	t = i + 1
	ans = l.count(t)
	print(ans)

N, M, *cnt = open(0).read().split()
from collections import Counter
cnt = Counter(cnt)
for i in range(1,int(N)+1):
    print(cnt[str(i)])

n,m=map(int,input().split())
roads=[0 for _ in range(n)]
for _ in range(m):
    a,b=map(int,input().split())
    roads[a-1]+=1
    roads[b-1]+=1
for i in roads:
    print(i)

N,M = map(int,input().split())
city = [0] * N

for _ in range(M):
  a,b = map(int,input().split())
  city[a-1] += 1
  city[b-1] += 1
  
for ans in city:
  print(ans)

N,M=map(int,input().split())
city=[0]*N
for i in range(M):
  road=list(map(int,input().split()))
  for j in road:
    city[j-1]+=1
for i in city:
  print(i)

n, m = map(int, input().split())
a = []
for i in range(m):
  x, y = map(int, input().split())
  a.append(x)
  a.append(y)
for i in range(1, n + 1):
  print(a.count(i))

import itertools

N, M = list(map(int, input().split()))

res = []

for i in range(M):
    ab = list(map(int, input().split()))
    res.append(ab)

res = list(itertools.chain.from_iterable(res))

for i in range(N):
    print((res.count(i+1)))


lst1 = input().split()

N = int(lst1[0])
M = int(lst1[1])

lst2 = []

for i in range(M):
   lst2.append(input().split())

lst3 = []
for i in range(N):
   lst3.append(0)

for i in range(M):
   for j in range(2):
      lst3[ int(lst2[i][j]) - 1 ] += 1

for i in range(N):
   print(lst3[i])

n, m = map(int, input().split())
edge = [[] for _ in range(n)]
for _ in range(m):
    a, b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
print("\n".join(list(map(lambda x:str(len(x)), edge))))

n,m=map(int,input().split())
A=[]
B=[]
for i in range(m):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
for j in range(n):
    print(A.count(j+1)+B.count(j+1))

n,m=map(int,input().split())
L=[[0 for _ in range(n)] for _ in range(n)]
for _ in range(m):
    a,b=map(int,input().split())
    L[a-1][b-1]+=1
    L[b-1][a-1]+=1
for i in range(n):
    print(sum(L[i]))

#n = int(input())
n, m = list(map(int, input().split()))
#l = list(map(int,input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
dic = {i: 0 for i in range(1, n+1)}
for i in range(m):
    a, b = list(map(int, input().split()))
    dic[a] = dic[a]+1
    dic[b] = dic[b]+1

for i in range(1, n+1):
    print((dic[i]))


import numpy as np
n,m = map(int, input().split())
ans = np.zeros(n, dtype=int)
for i in range(m):
    a,b = map(int, input().split())
    ans[a-1] += 1
    ans[b-1] += 1
for i in range(n):
    print(ans[i])

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

for ans in nums:
    print(ans)

n,m = map(int,input().split())
ans = [0]*n
for i in range(m):
  a,b = map(int,input().split())
  ans[a-1] += 1
  ans[b-1] += 1
for i in range(n):
  print(ans[i])

def actual(N, M, A, B):
    AB = A + B

    counts = [AB.count(i) for i in range(1, N + 1)]
    
    return '\n'.join(map(str, counts))

N, M = list(map(int, input().split()))
A, B = [], []
for _ in range(M):
  a, b = list(map(int, input().split()))
  A.append(a)
  B.append(b)
  
print((actual(N, M, A, B)))


n, m = map(int, input().split())
count = [0] * n
for i in range(m):
    a, b = map(int, input().split())
    count[a-1] += 1
    count[b-1] += 1
for i in range(n):
    print(count[i])

n,m=map(int,input().split())
d=[0]*n
for i in range(m):
  a,b=map(int,input().split())
  d[a-1]+=1
  d[b-1]+=1
for i in d:
  print(i)

c, r = [int(x) for x in input().split()]
total = [0] * c
for i in range(r):
    f, s = [int(x) for x in input().split()]
    total[f - 1] += 1
    total[s - 1] += 1

for number in total:
    print(number)
    


N, M = list(map(int, input().split()))
data = [[] for _ in range(N + 1)]
for i in range(M):
    x, y = list(map(int, input().split()))
    data[x].append(y)
    data[y].append(x)

for i in range(1, N + 1):
    print((len(data[i])))


from typing import List


def answer(n: int, m: int, ab_s: List[List[int]]) -> List[int]:
    roads = [0 for _ in range(n)]
    for ab in ab_s:
        a, b = ab
        roads[a - 1] += 1
        roads[b - 1] += 1

    return roads


def main():
    n, m = map(int, input().split())
    ab_s = [list(map(int, input().split())) for _ in range(m)]
    for i in answer(n, m, ab_s):
        print(i)


def __starting_point():
    main()
__starting_point()

n, m = map(int, input().split())
count = [0]*n
##print(count)
for i in range(m):
    a, b = map(int, input().split())
    count[a-1]+=1
    count[b-1]+=1
    ##print(count)
for i in count:
    print(i)

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

n,m = map(int,input().split())
ans = [0]*n
for _ in range(m):
    a,b = map(int,input().split())
    ans[a-1] += 1
    ans[b-1] += 1
for i in range(n):
    print(ans[i])

n,m = map(int,input().split())
l = [0]*n
for i in range(m):
    a,b = map(int,input().split())
    l[a-1] +=1
    l[b-1] +=1
for i in l:
    print(i)

n , m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
ans = []
for i in range(n):
    cnt = 0
    for j in range(m):
        if ab[j][0] == i+1 or ab[j][1] == i+1:
            cnt += 1
    ans.append(cnt)
for k in range(n):
    print(ans[k])

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

l=[]

for i in range(m):
    a,b = map(int, input().split())
    l.append(a)
    l.append(b)
    
for i in range(n):
    print(l.count(i+1))

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

ar = [0] * n

for i in range(m):
  a, b = map(int, input().split())
  ar[a-1] += 1
  ar[b-1] += 1
for i in range(n):
  print(ar[i])



N, M = map(int, input().split())
tree = [[] for _ in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

for i in range(N):
    print(len(tree[i]))

n, m = map(int, input().split())
road_list = []

for _ in range(m):
    a, b = (input().split())
    road_list.append(a)
    road_list.append(b)
    
for i in range(1, n + 1):
  print(road_list.count(str(i)))

n,m=list(map(int,input().split()))
a_s=[]
b_s=[]
for i in range(m):
  a,b=list(map(int,input().split()))
  a_s.append(a)
  b_s.append(b)

for i in range(1,n+1):
  print((a_s.count(i)+b_s.count(i)))


# -*- coding: utf-8 -*-

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

for i in range(N):
    print(load_num[i])

n,m=map(int,input().split())
c={i:0 for i in range(1,n+1)}
for a,b in [list(map(int,input().split())) for i in range(m)]:
  c[a]+=1;c[b]+=1
print(*c.values(),sep='\n')

N, M = map(int, input().split())
L = [0] * N
for i in range(M):
  a, b = map(int, input().split())
  L[a-1] += 1
  L[b-1] += 1
print(*L, sep = "\n")


N, M = list(map(int, input().split()))
# 都市Aと都市Bを結ぶ路線M
A_B = [list(map(int, input().split())) for _ in range(M)]
ans = [0] * N

for a, b in A_B:
    ans[a-1] += 1
    ans[b-1] += 1
for a in ans:
    print(a)


N,M = list(map(int,input().split()))
AB = [list(map(int,input().split())) for _ in range(M)]

WAY = [0] * (N+1)
for a,b in AB:
  WAY[a] += 1
  WAY[b] += 1
  
print(("\n".join(map(str,WAY[1:]))))
  


import itertools
n,m = map(int,input().split())
li = [list(map(int,input().split())) for i in range(m)]
#print(li)
lis = list(itertools.chain.from_iterable(li))
#print(lis)
for i in range(1,n+1):
    print(lis.count(i))

n, m = map(int,input().split())
road = [list(map(int,input().split())) for _ in range(m)]
cnt = [0] * n
for i in road:
    cnt[i[0]-1] += 1
    cnt[i[1]-1] += 1
for j in range(n):
    print(cnt[j])

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

l = []
for i in range(m):
    x,y = map(int,input().split())
    l.append(x)
    l.append(y)

for i in range(n):
    print(l.count(i+1))

n, m = map(int, input().split())
a = [0] * m
b = [0] * m
for i in range(m):
    a[i], b[i] = map(int, input().split())

ans = [0] * n

for i in range(m):
    ans[a[i]-1] += 1
    ans [b[i]-1] += 1

for i in ans:
    print(i)

# ABC061B
N,M = map(int, input().split())
AB = [[] for _ in range(N)]
for _ in range(M):
    a,b = map(int, input().split())
    AB[a-1].append(b-1)
    AB[b-1].append(a-1)
for i in range(N):
    print(len(AB[i]))

N, M = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(M)]

d = {i+1: 0 for i in range(N)}
for i in range(M):
    a = ab[i][0]
    b = ab[i][1]
    d[a] += 1
    d[b] += 1

for i in range(N):
    print((d[i+1]))


n,m=map(int,input().split())
c={i:0 for i in range(1,n+1)}
for _ in range(m):
  a,b=map(int,input().split())
  c[a]+=1;c[b]+=1
print(*c.values(),sep='\n')

n, m = map(int, input().split())
ar = [0] * n
for i in range(m):
  a, b = map(int, input().split())
  ar[a-1] += 1
  ar[b-1] += 1
for i in range(n):
  print(ar[i])

n, m = map(int, input().split())
edges = [tuple(map(int, input().split())) for _ in range(m)]

c = [[] for _ in range(n + 1)]

for a, b in edges:
    c[a].append(b)
    c[b].append(a)

for i in range(1, n + 1):
    print(len(c[i]))

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

#!/usr/bin/env python3


def main():
    import numpy as np

    N, M = list(map(int, input().split()))
    ab = np.array([list(map(int, input().split())) for _ in range(M)])
    for i in range(1, N+1):
        print((np.count_nonzero(ab == i)))


main()


n, m = list(map(int, input().split()))
cnt = [0] * n
for i in range(m):
    a, b = list(map(int, input().split()))
    cnt[a-1] += 1
    cnt[b-1] += 1
for i in range(n):
    print((cnt[i]))


n,m = map(int,input().split())
N = list(range(1,n+1))
D = dict.fromkeys(N,0)

for _ in range(m):
  R = list(map(int,input().split()))
  for r in R:
    D[r] += 1

for d in D.values():
  print(d)

N, M = map(int,input().split())
list = []

for i in range(M):
    a, b = map(int,input().split())
    list.append(a)
    list.append(b)

for j in range(1,N+1):
    print(list.count(j))

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

graph = [[] for i in range(n+1)]

for i in range(m):
  a, b = map(int, input().split())
  graph[a].append(b)
  graph[b].append(a)

for i in range(n):
  print(len(graph[i+1]))

n, m = map(int, input().split())
s = []
N = [0 for i in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    s.append([a,b])
    N[a-1] += 1
    N[b-1] += 1
for j in range(n):
    print(N[j])

nm = list(map(int, input().split()))
n, m = nm[0], nm[1]
ab_list = [list(map(int, input().split())) for _ in range(m)]
results = dict([(i, 0) for i in range(1, n + 1)])
for ab in ab_list:
    results[ab[0]] += 1
    results[ab[1]] += 1

for i in range(1, n + 1):
    print((results[i]))


N, M = tuple(map(int, input().split()))

count_road = [[0 for _ in range(N+1)] for _ in range(N+1)]

for _ in range(M):
    a, b = tuple(map(int, input().split()))
    count_road[a][b] += 1
    count_road[b][a] += 1
    
for i in range(1, N+1):
    print(sum(count_road[i]))

n, m = map(int, input().split())
city = [0] * n
for i in range(m):
    a, b = map(int, input().split())
    city[a - 1] += 1
    city[b - 1] += 1

for i in city:
    print(i)

N,M=map(int,input().split())
cnt=[0 for i in range(N)]


for i in range(M):
    a,b=map(int,input().split())
    cnt[a-1]+=1
    cnt[b-1]+=1

for i in range(N):
    print(cnt[i])

from collections import Counter

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

l=[]
for i in range(m):
  lis=list(map(int,input().split()))
  l+=lis
  
l=Counter(l)

for i in range(1,n+1):
  print(l[i])

N, M = map(int,input().split())
ab_list = []

for i in range(M):
    a, b = map(int,input().split())
    ab_list.append(a)
    ab_list.append(b)
    
for i in range(1, N + 1):
    print(ab_list.count(i))

N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(M)]
ans = [0 for _ in range(N)]
n = 1
while True:
    for i in range(M):
        for j in range(2):
            if n == ab[i][j]:
                ans[n-1] += 1
    if n == N:
        break
    n += 1
for i in range(N):
    print(ans[i])

from collections import defaultdict
n,m = map(int, input().split())
ans = 0
route = [[0]*(n+1) for i in range(n+1)]

for i in range(m):
  f,t = map(int, input().split())
  route[f][t] += 1
  route[t][f] += 1

for i in range(1, n+1):
  print(sum(route[i]))

import sys
readline = sys.stdin.readline

N,M = map(int,readline().split())
ans = [0] * N

for i in range(M):
  ab = list(map(int,readline().split()))
  for a in ab:
    ans[a - 1] += 1
    
for a in ans:
  print(a)

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

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

n,m=map(int,input().split())
c=[0]*n
for _ in range(m):
    a,b=[int(j) for j in input().split()]
    c[a-1]+=1
    c[b-1]+=1
for i in c:
    print(i)

n, m = map(int, input().split())
road = [list(map(int, input().split())) for _ in range(m)]

road = sum(road, [])
for i in range(1, n+1):
  print(road.count(i))

N, M = map(int, input().split())
L = []
for i in range(M):
  a, b = map(int, input().split())
  L.append(a)
  L.append(b)

for n in range(1, N+1):
  print(L.count(n))

N,M=list(map(int,input().split()))
ans=[0 for i in range(N)]
for _ in range(M):
    a,b=list(map(int,input().split()))
    ans[a-1]+=1
    ans[b-1]+=1

for x in ans:
    print(x)


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