from collections import defaultdict N, M = map(int, input().split()) adj = defaultdict(list) for _ in range(M): u, v = map(lambda x: int(x)-1, input().split()) adj[u].append(v) adj[v].append(u) blacks = {0} for _ in range(N): nodes = set() for v in blacks: for to in adj[v]: if to in blacks: continue nodes.add(to) print(len(nodes)) blacks = nodes