from collections import deque N, M = map(int,input().split()) G = [list() for i in range(N+1)] for i in range(M): u, v = map(int,input().split()) G[u].append(v) G[v].append(u) d = [-1]*(N+1) d[1] = 0 dist = [0]*(N+1) dist[0] += 1 Q = deque() Q.append(1) while len(Q) >= 1: x = Q.popleft() for nex in G[x]: if d[nex] == -1: d[nex] = d[x] + 1 dist[d[nex]] += 1 Q.append(nex) ans = [0] for i in range(1,N+1): if i % 2 == 1: if i == 1: ans.append(dist[i]) else: ans.append(ans[i-2] + dist[i]) else: if i == 2: if len(G[1]) == 0: ans.append(dist[i]) else: ans.append(ans[i-2] + dist[i]) else: ans.append(ans[i-2] + dist[i]) for i in range(1,N+1): print(ans[i])