#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chmin(T &x, const T &y) {
  if (x > y) x = y;
}
template <typename T>
void chmax(T &x, const T &y) {
  if (x < y) x = y;
}
int read() {
  char c;
  while ((c = getchar()) < '-')
    ;
  if (c == '-') {
    int x = (c = getchar()) - '0';
    while ((c = getchar()) >= '0') x = x * 10 + c - '0';
    return -x;
  }
  int x = c - '0';
  while ((c = getchar()) >= '0') x = x * 10 + c - '0';
  return x;
}
const int N = 5e5 + 5;
vector<pair<int, int> > lk[N];
pair<int, int> edge[N];
int to_edge[N], offset[N];
int dfn[N], low[N], tot, fa[N], w_to_fa[N], dp[N];
void tarjan(int x) {
  dfn[x] = low[x] = ++tot;
  for (auto e : lk[x]) {
    int y, w;
    tie(y, w) = e;
    if (y == fa[x]) continue;
    if (!dfn[y]) {
      fa[y] = x;
      w_to_fa[y] = w;
      tarjan(y);
      chmin(low[x], low[y]);
    } else
      chmin(low[x], dfn[y]);
  }
  for (auto e : lk[x]) {
    int y, w;
    tie(y, w) = e;
    if (low[y] >= dfn[x] && fa[y] != x) {
      vector<int> e;
      e.push_back(w);
      for (int z = y; z != x; z = fa[z]) e.push_back(w_to_fa[z]);
      rotate(e.begin(), min_element(e.begin(), e.end()), e.end());
      int p = 0;
      while (p + 1 < e.size() && e[p + 1] > e[p]) ++p;
      int i = p;
      while (i + 1 < e.size() && e[i + 1] < e[i]) ++i;
      if (i + 1 == e.size()) to_edge[e[p]] = e[0];
    }
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    int x = read(), y = read();
    edge[i] = pair<int, int>(x, y);
    lk[x].push_back(pair<int, int>(y, i));
    lk[y].push_back(pair<int, int>(x, i));
  }
  tarjan(1);
  for (int i = 1; i <= n; ++i) dp[i] = 1;
  for (int i = m; i >= 1; --i) {
    int x, y;
    tie(x, y) = edge[i];
    int sum = dp[x] + dp[y] - offset[i];
    dp[x] = dp[y] = sum;
    offset[to_edge[i]] = sum;
  }
  for (int i = 1; i <= n; ++i) printf("%d ", dp[i] - 1);
}
