#include #include using namespace std; using ll = long long; using ul = unsigned long; using ld = long double; using st = string; using mint = atcoder::modint998244353; using Mint = atcoder::modint1000000007; #define vl vector #define vvl vector> #define vvvl vector>> #define vvvvl vector>>> #define vd vector #define vvd vector> #define vvvd vector>> #define vb vector #define vvb vector> #define vvvb vector>> #define vs vector #define vvs vector> #define vvvs vector>> #define vp vector> #define vvp vector>> #define vvvp vector>>> #define vm vector #define vvm vector> #define vM vector #define vvM vector> #define cmx(n,v) n=nv?v:n #define all(n) begin(n),end(n) #define nxp(a) next_permutation(all(a)) #define rev(n) reverse(all(n)) #define sor(n) stable_sort(all(n)) #define rep(i,n) for(ll i=0;i<(n);++i) #define reprev(i,n) for(ll i=n-1;0<=i;--i) #define rrep(i,a,n) for(ll i=a;i<(n);++i) #define sz(n) n.size() #define bit(j,i) (i&(1<0){ res++; N/=10; } return res; } ll factorial(ll n, ll mod = 1e18) { ll ans = 1; for(ll i = n; i >= 2; i--) ans = (ans * i) % mod; return ans; } ll round_up(ll x,ll y){ return (x+y-1)/y; } ll floor_int(ll x,ll m){ ll r=(x%m+m)%m; //負の剰余を正の剰余に置き換える return (x-r)/m; //return } ll rmd(ll x,ll m){ ll r=(x%m+m)%m; //負の剰余を正の剰余に置き換える return r; } ll rmd_2(ll x,ll m){ ll r=(x%m+m)%m; //負の剰余を正の剰余に置き換える return (m-r)%m; //return } ll bubble_sort(vl& a,ll& n){ ll res=0; rep(i,n-1){ for(ll j=n-1;j>i;j--){ if(a[j-1]>a[j]){ swap(a[j-1],a[j]); res++; } } } return res; } ll sum_v(vl a){ ll res=0; ll n=sz(a); rep(i,n) res+=a[i]; return res; } ll stair_sum(ll from,ll to){ return (from+to)*(to-from+1)/2; } ll Power(ll var, ll p) { if (p == 1) return var; ll ans = Power(var * var, p / 2); if (p & 1) ans *= var;; return ans; } ll cnt_01(ll n,ll now){ ll res=0; res+=(n/now)*(now/2); if(n%now>=now/2) res+=n%now-(now/2)+1; return res; } mint m_Power(mint var,ll p) { if (p == 1) return var; mint ans = m_Power(var * var, p / 2); if (p & 1) ans *= var;; return ans; } Mint M_Power(Mint var,ll p) { if (p == 1) return var; Mint ans = M_Power(var * var, p / 2); if (p & 1) ans *= var;; return ans; } bool is_prime(ll N){ if(N==1) return false; if(N==2) return true; if(N%2==0) return false; for(ll p=3;p*p<=N;p+=2) if(N%p==0) return false; return true; } bool in_out(ll x,ll y,ll h,ll w){ return 0<=x and xn||p>res[d]) break; res[p*d]=p; } } return res; } vvl to_grid(vl &a,ll k){ ll n=sz(a); ll m=(n+k-1)/k; vvl b(k,vl(m,inf)); rep(i,n) b[i%k][i/k]=a[i]; return b; } vvl rotate_ll(vvl& V2d,ll wise){ vvl a=V2d; ll h=sz(a),w=sz(a[0]); vvl res(w,vl(h)); if(wise) {rep(i,h)rep(j,w) res[j][h-i-1]=a[i][j];} else {rep(i,h)rep(j,w) res[w-j-1][i]=a[i][j];} return res; } vs rotate_st(vs s,ll wise){ vs a=s; ll h=sz(a),w=sz(a[0]); vs res(w); rep(i,w) res[i].append(h,'.'); if(wise) {rep(i,h)rep(j,w) res[j][h-i-1]=a[i][j];} else {rep(i,h)rep(j,w) res[w-j-1][i]=a[i][j];} return res; } vp prime_factorize(ll N){ vp res; for (ll a = 2; a * a <= N; ++a) { if (N % a != 0) continue; ll ex = 0; while (N % a == 0) { ex++; N /= a; } res.push_back({a, ex}); } if (N != 1) res.push_back({N, 1}); return res; } template void input(T &a) { cin >> a; }; template void input(T1&a, T2 &...b) { cin >> a; input(b...); }; template vector rd(size_t n) { vector ts(n); for (size_t i = 0; i < n; i++) cin >> ts[i]; return ts; } template void read_tuple_impl(TV&) {} template void read_tuple_impl(TV& ts) { get(ts).emplace_back(*(istream_iterator(cin))); read_tuple_impl(ts); } template decltype(auto) read_tuple(size_t n) { tuple...> ts; for (size_t i = 0; i < n; i++) read_tuple_impl(ts); return ts; } ll di[8]={1,-1,0,0,1,1,-1,-1}; ll dj[8]={0,0,1,-1,1,-1,-1,1}; //std::setprecision(15); //2^29<10^9 int main(){ ios::sync_with_stdio(0); cin.tie(0); ll n,m; cin >> n >> m; vvl g(n); rep(i,m){ ll u,v; cin >> u >> v; u--,v--; g[u].push_back(v); g[v].push_back(u); } if(sz(g[0])==0){ cout << 1 << endl; rep(i,n-1) cout << 0 << endl; return 0; } queue q; q.push(0); vl dis(n,inf); dis[0]=0; while(sz(q)){ ll now=q.front(); q.pop(); for(ll nx:g[now]){ if(dis[nx]!=inf) continue; dis[nx]=dis[now]+1; q.push(nx); } } vl cnt(n+1,0); rep(i,n){ if(dis[i]!=inf)cnt[dis[i]]++; } vl ans(2,0); rep(i,n+1){ ans[i%2]+=cnt[i]; if(i==0) continue; cout << ans[i%2] << endl; } }