namespace AtCoder; #nullable enable using System.Numerics; class Graph { public struct Edge { public int Ab { get; set; } public int Ad { get; set; } public T Distance { get; set; } } public int N { get; private init; } public bool Directed { get; private init; } public List> AdjacencyList { get; private init; } public List Edges { get; private init; } public Graph(int verticals, IReadOnlyList edges, bool directed) { N = verticals; Directed = directed; AdjacencyList = new List>(); for (var i = 0; i < N; i++) AdjacencyList.Add(new List<(int, int)>()); Edges = new List(); for (var i = 0; i < edges.Count; i++) { var edge = edges[i]; Edges.Add(edge); AdjacencyList[edge.Ab].Add((edge.Ad, i)); if (!Directed) AdjacencyList[edge.Ad].Add((edge.Ab, i)); } } } class GraphBuilder { public static Graph SimpleGraph(int verticals, (int ab, int ad)[] edges, bool directed) { var e = edges.Select(e => new Graph.Edge { Ab = e.ab, Ad = e.ad, Distance = 1 }).ToList(); return new(verticals, e, directed); } } static class Extensions { public static T[] Repeat(this int time, Func F) => Enumerable.Range(0, time).Select(_ => F()).ToArray(); } class AtCoder { object? Solve() { var n = Int(); var m = Int(); var edges = m.Repeat(() => (Int() - 1, Int() - 1)); var g = GraphBuilder.SimpleGraph(n, edges, false).AdjacencyList; if (g[0].Count == 0) { Out(new int[n]); return null; } var xz = n.Repeat(() => n + 1); var q = new Queue(); xz[0] = 0; q.Enqueue(0); while (q.Count > 0) { var v = q.Dequeue(); var w = xz[v]; foreach (var (next, _) in g[v]) { if (xz[next] <= w + 1) continue; xz[next] = w + 1; q.Enqueue(next); } } var az = new int[n + 1]; for (var i = 0; i < n; i++) { var j = xz[i]; if (j <= n) az[j]++; } for (var i = 2; i <= n; i++) az[i] += az[i - 2]; Out(az.Skip(1)); return null; } public static void Main() => new AtCoder().Run(); public void Run() { var res = Solve(); if (res != null) { if (res is bool yes) res = yes ? "Yes" : "No"; sw.WriteLine(res); } sw.Flush(); } string[] input = Array.Empty(); int iter = 0; readonly StreamWriter sw = new(Console.OpenStandardOutput()) { AutoFlush = false }; string String() { while (iter >= input.Length) (input, iter) = (Console.ReadLine()!.Trim().Split(' '), 0); return input[iter++]; } T Input() where T : IParsable => T.Parse(String(), null); int Int() => Input(); void Out(object? x, string? separator = null) { separator ??= Environment.NewLine; if (x is System.Collections.IEnumerable obj and not string) { var firstLine = true; foreach (var item in obj) { if (!firstLine) sw.Write(separator); firstLine = false; sw.Write(item); } } else sw.Write(x); sw.WriteLine(); } }