#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5, inf = 0x3fffffff;
struct Edge {
  int nxt, to;
} e[maxn];
int hd[maxn], e_cnt = 1;
void add(int u, int v) {
  e[++e_cnt] = (Edge){hd[u], v};
  hd[u] = e_cnt;
}
stack<int> stk;
int n, m, dfn[maxn], low[maxn], clk, rec[maxn], sub[maxn], f[maxn];
void tarjan(int u, int r) {
  dfn[u] = low[u] = ++clk;
  for (int i = hd[u]; i; i = e[i].nxt)
    if (e[i].to != r && dfn[e[i].to] < dfn[u]) {
      stk.push(i);
      if (!dfn[e[i].to]) {
        tarjan(e[i].to, u);
        low[u] = min(low[u], low[e[i].to]);
        if (low[e[i].to] > dfn[u]) {
          stk.pop();
          continue;
        }
        if (low[e[i].to] >= dfn[u]) {
          int x, mini = inf, maxi = 0;
          vector<int> vec;
          do {
            x = stk.top();
            stk.pop();
            vec.push_back(x / 2);
            mini = min(mini, x / 2);
            maxi = max(maxi, x / 2);
          } while (x != i);
          int min_id, max_id, siz = vec.size();
          for (int j = 0; j <= siz - 1; j++)
            if (vec[j] == mini)
              min_id = j;
            else if (vec[j] == maxi)
              max_id = j;
          bool flg = true;
          for (int j = (min_id + 1) % siz; j != max_id; j = (j + 1) % siz)
            if (vec[j] < vec[(j - 1 + siz) % siz]) flg = false;
          for (int j = (min_id - 1 + siz) % siz; j != max_id;
               j = (j - 1 + siz) % siz)
            if (vec[j] < vec[(j + 1) % siz]) flg = false;
          if (flg) sub[mini] = maxi;
        }
      } else
        low[u] = min(low[u], dfn[e[i].to]);
    }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    add(x, y);
    add(y, x);
  }
  tarjan(1, 0);
  for (int i = 1; i <= n; i++) f[i] = 1;
  for (int i = m; i; i--) {
    int x = e[i * 2].to, y = e[i * 2 + 1].to;
    rec[i] = f[x] + f[y];
    f[x] = f[y] = f[x] + f[y] - rec[sub[i]];
  }
  for (int i = 1; i <= n; i++) cout << f[i] - 1 << ' ';
  return 0;
}
