#include using namespace std; #define pb emplace_back #define mp make_pair using ll = long long; using pii = pair; constexpr int mod = 998244353; constexpr int inf = 0x3f3f3f3f; constexpr int N = 2e5 + 10; int n, m, dep[N], cnt[N]; vector V[N]; void _main(){ int x, y; cin >> n >> m; while(m--){ cin >> x >> y; V[x].pb(y); V[y].pb(x); } if(V[1].empty()){ for(int i=1; i<=n; ++i) cout << "0\n"; return; } memset(dep, -1, sizeof(dep)); dep[1] = 0; queue Q; Q.push(1); while(!Q.empty()){ int x = Q.front(); Q.pop(); ++cnt[dep[x]]; for(int y : V[x]){ if(dep[y] == -1){ dep[y] = dep[x] + 1; Q.push(y); } } } int c0 = 0, c1 = 1; for(int i=1; i<=n; ++i){ swap(c0, c1); c1 += cnt[i]; cout << c1 << '\n'; } } int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); _main(); return 0; }