#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, dp[2505][2505][3][3], size[2505], top[2505], vis[2505],
    fl[2505], fa[2505], dep[2505];
int fst[2505], to[2505 * 4], nxt[2505 * 4], l;
void link(int x, int y) {
  to[++l] = y;
  nxt[l] = fst[x];
  fst[x] = l;
  to[++l] = x;
  nxt[l] = fst[y];
  fst[y] = l;
}
void upd(int &x, int y) {
  if (y > x) x = y;
}
void merge(int a, int b) {
  int n, m;
  n = size[a];
  m = size[b];
  static int tmp[2505][3][3];
  for (int i = 0; i <= n + m; i++)
    for (int j = 0; j < 3; j++)
      for (int k = 0; k < 3; k++) tmp[i][j][k] = -1000000;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= m; j++) {
      if (top[a] == top[b] && top[b]) {
        for (int x = 0; x < 3; x++) {
          upd(tmp[i + j][0][x], dp[a][i][0][0] + dp[b][j][0][x]);
          upd(tmp[i + j][0][x], dp[a][i][0][0] + dp[b][j][1][x]);
          upd(tmp[i + j][0][x], dp[a][i][0][0] + dp[b][j][2][x]);
        }
        for (int x = 1; x < 3; x++) {
          for (int y = 0; y < 3; y++) {
            upd(tmp[i + j][x][y], dp[a][i][x][0] + dp[b][j][0][y]);
            upd(tmp[i + j][x][y], dp[a][i][x][0] + dp[b][j][x][y]);
          }
        }
      }
      if (a == top[b]) {
        for (int x = 0; x < 3; x++) {
          upd(tmp[i + j][0][0], dp[a][i][0][0] + dp[b][j][0][x]);
          upd(tmp[i + j][0][0], dp[a][i][0][0] + dp[b][j][1][x]);
          upd(tmp[i + j][0][0], dp[a][i][0][0] + dp[b][j][2][x]);
        }
        for (int x = 1; x < 3; x++) {
          upd(tmp[i + j][x][0], dp[a][i][x][0] + dp[b][j][0][0]);
          upd(tmp[i + j][x][0], dp[a][i][x][0] + dp[b][j][x][0]);
          upd(tmp[i + j][x][0], dp[a][i][x][0] + dp[b][j][0][x]);
          upd(tmp[i + j][x][0], dp[a][i][x][0] + dp[b][j][x][x]);
        }
      }
      if (top[a] == 0 && top[b] == 0) {
        upd(tmp[i + j][0][0], dp[a][i][0][0] + dp[b][j][0][0]);
        upd(tmp[i + j][0][0], dp[a][i][0][0] + dp[b][j][1][0]);
        upd(tmp[i + j][0][0], dp[a][i][0][0] + dp[b][j][2][0]);
        for (int x = 1; x < 3; x++) {
          for (int y = 0; y < 3; y++) {
            upd(tmp[i + j][x][y], dp[a][i][x][0] + dp[b][j][0][y]);
            upd(tmp[i + j][x][y], dp[a][i][x][0] + dp[b][j][x][y]);
          }
        }
      }
      if (top[a] && top[a] != top[b]) {
        for (int x = 0; x < 3; x++) {
          upd(tmp[i + j][0][x], dp[a][i][0][x] + dp[b][j][0][0]);
          upd(tmp[i + j][0][x], dp[a][i][0][x] + dp[b][j][1][0]);
          upd(tmp[i + j][0][x], dp[a][i][0][x] + dp[b][j][2][0]);
        }
        for (int x = 1; x < 3; x++) {
          for (int y = 0; y < 3; y++) {
            upd(tmp[i + j][x][y], dp[a][i][x][y] + dp[b][j][0][0]);
            upd(tmp[i + j][x][y], dp[a][i][x][y] + dp[b][j][x][0]);
          }
        }
      }
    }
  for (int i = 0; i <= n + m; i++)
    for (int j = 0; j < 3; j++)
      for (int k = 0; k < 3; k++) dp[a][i][j][k] = tmp[i][j][k];
}
void dfs(int x) {
  vis[x] = 1;
  size[x] = 1;
  dep[x] = dep[fa[x]] + 1;
  dp[x][0][0][0] = 0;
  dp[x][0][1][0] = 1;
  dp[x][0][2][0] = -1000000;
  dp[x][1][0][0] = -1000000;
  dp[x][1][1][0] = -1000000;
  dp[x][1][2][0] = 0;
  int tmp = 0;
  for (int i = fst[x]; i; i = nxt[i])
    if (!vis[to[i]]) {
      fa[to[i]] = x;
      dfs(to[i]);
      if (top[to[i]] && top[to[i]] != x)
        tmp = to[i];
      else {
        merge(x, to[i]);
        size[x] += size[to[i]];
      }
    } else {
      if (dep[to[i]] < dep[x] && to[i] != fa[x]) top[x] = to[i], fl[x] = 1;
    }
  if (tmp) {
    top[x] = top[tmp];
    merge(x, tmp);
    size[x] += size[tmp];
  }
  if (fl[x]) {
    for (int i = 0; i <= size[x]; i++) {
      dp[x][i][0][1] = -1000000;
      dp[x][i][0][2] = -1000000;
      dp[x][i][1][1] = dp[x][i][1][0];
      dp[x][i][1][0] = -1000000;
      dp[x][i][1][2] = -1000000;
      dp[x][i][2][2] = dp[x][i][2][0];
      dp[x][i][2][1] = -1000000;
      dp[x][i][2][0] = -1000000;
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d%d", &x, &y), link(x, y);
  dfs(1);
  for (int i = 0; i <= n; i++) {
    int ans = -1000000;
    for (int x = 0; x < 3; x++) {
      upd(ans, dp[1][i][x][0]);
    }
    printf("%d ", ans);
  }
}
