N,M=map(int,input().split()) #A=list(map(int, input().split())) D=[[] for i in range(N)] for i in range(M): x,y=map(int,input().split()) x-=1;y-=1 D[x].append(y);D[y].append(x) from collections import deque d=deque() V=[-1]*N V[0]=0 d.append(0) E=[0]*(N+1) E[0]+=1 while d: now=d.popleft() for nex in D[now]: if V[nex]==-1: V[nex]=V[now]+1 d.append(nex) E[V[nex]]+=1 p,q=1,0 for i in range(1,N+1): if i%2==1: q+=E[i] print(q) else: p+=E[i] print(p)