#include using namespace std; #include using namespace atcoder; #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) using mint = modint998244353; #define ull unsigned long long random_device rnd; mt19937 mt(rnd()); int RandInt(int a, int b) { return a + mt() % (b - a + 1); } int main() { int N, M; cin >> N >> M; vector> to(N); for (int i = 0; i < M; ++i) { int u, v; cin >> u >> v; u--; v--; to[u].push_back(v); to[v].push_back(u); } vector color(N, 0); // 0:白, 1:黒 color[0] = 1; vector black_cnt(N); for (int t = 0; t < N; ++t) { set red; rep(u,N) { if (color[u] == 0) { for (int v : to[u]) { if (color[v] == 1) { red.insert(u); break; } } } } rep(u,N) { if (color[u] == 1) { color[u] = 0; } } for (int u : red) { color[u] = 1; } int cnt = 0; rep(u,N) { if (color[u] == 1) { cnt++; } } black_cnt[t] = cnt; cout << cnt << endl; } return 0; }