import sys
input = sys.stdin.readline

from collections import deque

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

E=[[] for i in range(N)]

for i in range(M):
    x,y=map(int,input().split())
    x-=1
    y-=1
    E[x].append(y)
    E[y].append(x)

if E[0]==[]:
    for i in range(N):
        print(0)
    exit()

Q=deque()
Q.append(0)
DIS=[1<<30]*N

DIS[0]=0
while Q:
    x=Q.popleft()
    for to in E[x]:
        if DIS[to]>DIS[x]+1:
            DIS[to]=DIS[x]+1
            Q.append(to)

ANS=[0]*(N+1)
for d in DIS:
    if d<N+1:
        ANS[d]+=1

for i in range(2,N+1):
    ANS[i]+=ANS[i-2]

for ans in ANS[1:]:
    print(ans)