#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
struct edge {
  int to, next, id;
} e[N * 2];
int head[N], q[N], nx[N], tot, n, m;
int X[N], Y[N], f[N], del[N], to[N];
int dfn[N], low[N], fa[N], faid[N];
void add(int x, int y, int v) {
  e[++tot] = (edge){y, head[x], v};
  head[x] = tot;
}
void tarjan(int x) {
  dfn[x] = low[x] = ++dfn[0];
  for (int i = head[x]; i; i = e[i].next)
    if (e[i].to != fa[x]) {
      if (!dfn[e[i].to]) {
        fa[e[i].to] = x;
        faid[e[i].to] = e[i].id;
        tarjan(e[i].to);
        low[x] = min(low[x], low[e[i].to]);
      } else
        low[x] = min(low[e[i].to], low[x]);
    }
  for (int i = head[x]; i; i = e[i].next)
    if (e[i].to != fa[x] && fa[e[i].to] != x && dfn[e[i].to] > dfn[x]) {
      q[0] = 0;
      q[++q[0]] = e[i].id;
      for (int j = e[i].to; j != x; j = fa[j]) q[++q[0]] = faid[j];
      int idd = 1;
      for (int j = (int)(1); j <= (int)(q[0]); j++)
        nx[j] = (j == q[0] ? 1 : j + 1);
      for (int j = (int)(2); j <= (int)(q[0]); j++)
        if (q[j] < q[idd]) idd = j;
      int p1 = idd;
      for (; nx[p1] != idd && q[nx[p1]] > q[p1]; p1 = nx[p1])
        ;
      int p2 = p1;
      for (; nx[p1] != idd && q[nx[p1]] < q[p1]; p1 = nx[p1])
        ;
      if (nx[p1] == idd) to[q[p2]] = q[idd];
    }
}
int main(void) {
  scanf("%d%d", &n, &m);
  for (int i = (int)(1); i <= (int)(m); i++) {
    scanf("%d%d", &X[i], &Y[i]);
    add(X[i], Y[i], i);
    add(Y[i], X[i], i);
  }
  tarjan(1);
  for (int i = (int)(1); i <= (int)(n); i++) f[i] = 1;
  for (int i = (int)(m); i >= (int)(1); i--) {
    int v = f[X[i]] + f[Y[i]] - del[i];
    del[to[i]] = f[X[i]] = f[Y[i]] = v;
  }
  for (int i = (int)(1); i <= (int)(n); i++) printf("%d ", f[i] - 1);
  return 0;
}
