from heapq import * inf = 1 << 61 def dijkstra(S,N,G): dist = [inf for i in range(N)] dist[S] = 0 hq = [(0,S)] while len(hq): d,u = heappop(hq) if dist[u] < d: continue for v,c in G[u]: if dist[v] > dist[u] + c: dist[v] = dist[u] + c heappush(hq,(dist[v],v)) return dist N,M = map(int,input().split()) G = [[] for u in range(N)] for _ in range(M): u,v = map(int,input().split()) u -= 1 v -= 1 G[u].append((v,1)) G[v].append((u,1)) dist = dijkstra(0,N,G) C = [0 for u in range(N)] for u in range(N): if dist[u] == inf: continue C[dist[u]] += 1 o,e = 0,0 e = 1 for i in range(1,N): if i % 2: o += C[i] print(o) else: e += C[i] print(e) if e == 0: o = 0 if N % 2: print(o) else: print(e)