#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000;
int cycle[2505], F[2501][2501][3][3], parent[2505], distr[2][2505], siz[2505];
vector<int> E[2505], ch[2505];
bool back[2505];
void go(int x) {
  siz[x] = 1;
  for (auto it = E[x].begin(); it != E[x].end(); ++it) {
    if (parent[x] == *it) continue;
    if (!siz[*it]) {
      ch[x].push_back(*it);
      parent[*it] = x;
      go(*it);
      siz[x] += siz[*it];
    } else if (cycle[*it] != x) {
      back[x] = true;
      for (int i = x; i != *it; i = parent[i]) cycle[i] = *it;
    }
  }
  for (int choose = 0; choose < 3; ++choose)
    for (int pChoose = 0; pChoose < 3; ++pChoose) {
      int total = 0;
      bool f = 0;
      for (int a = 0; a <= siz[x]; ++a) distr[f][a] = -INF;
      distr[f][0] = 0;
      for (auto it = ch[x].begin(); it != ch[x].end(); ++it) {
        f = !f;
        int npChoose = cycle[*it] == cycle[x] ? pChoose
                       : cycle[*it] == x      ? choose
                                              : 0;
        for (int a = 0; a <= siz[x]; ++a) distr[f][a] = -INF;
        for (int a = 0; a <= total; ++a)
          for (int aa = 0; aa <= siz[*it]; ++aa) {
            int &v = distr[f][a + aa];
            v = max(v, distr[!f][a] + F[*it][aa][0][npChoose]);
            if (choose != 1) v = max(v, distr[!f][a] + F[*it][aa][2][npChoose]);
            if (choose != 2) v = max(v, distr[!f][a] + F[*it][aa][1][npChoose]);
          }
        total += siz[*it];
      }
      for (int a = 0; a <= siz[x]; ++a) {
        if (back[x] && pChoose + choose == 3)
          F[x][a][choose][pChoose] = -INF;
        else {
          int aa = a;
          if (choose == 1) --aa;
          F[x][a][choose][pChoose] =
              aa >= 0 ? distr[f][aa] + (choose == 2) : -INF;
        }
      }
    }
}
int main() {
  int N, M;
  scanf("%d%d", &N, &M);
  for (int i = 0; i < M; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    E[a].push_back(b);
    E[b].push_back(a);
  }
  go(1);
  for (int i = 0; i <= N; ++i) {
    int ans = -INF;
    for (int j = 0; j < 3; ++j) ans = max(ans, F[1][i][j][0]);
    printf("%d ", ans);
  }
  printf("\n");
}
