#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &x) {
  int f = 0;
  x = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) f |= (ch == '-');
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  if (f) x = -x;
}
const int N = 500005;
struct edge {
  int v, id, l;
} e[N << 1];
int h[N], u[N], v[N], d[N], fa[N], num[N];
int cur[N], f[N], g[N];
int n, m, tot;
void doit(vector<int> &e, vector<int> &p) {
  int sz = e.size(), k = max_element(e.begin(), e.end()) - e.begin();
  rotate(e.begin(), e.begin() + k, e.end());
  rotate(p.begin(), p.begin() + k, p.end());
  int t = min_element(e.begin(), e.end()) - e.begin();
  for (int i = (1); i <= (t); i++)
    if (e[i - 1] < e[i]) return;
  for (int i = (t); i <= (sz - 2); i++)
    if (e[i] > e[i + 1]) return;
  cur[e[t]] = e[0];
}
void dfs(int u) {
  for (int k = h[u]; k; k = e[k].l) {
    int v = e[k].v;
    if (v == fa[u]) continue;
    if (!d[v]) {
      d[v] = d[u] + 1;
      num[v] = e[k].id;
      fa[v] = u, dfs(v);
    } else if (d[v] < d[u]) {
      vector<int> ids, pts;
      ids.push_back(e[k].id), pts.push_back(u);
      for (int x = u; x != v; x = fa[x])
        ids.push_back(num[x]), pts.push_back(fa[x]);
      doit(ids, pts);
    }
  }
}
int main() {
  read(n), read(m);
  for (int i = (m); i >= (1); i--) {
    read(u[i]), read(v[i]);
    e[++tot] = (edge){v[i], i, h[u[i]]}, h[u[i]] = tot;
    e[++tot] = (edge){u[i], i, h[v[i]]}, h[v[i]] = tot;
  }
  d[1] = 1, dfs(1);
  for (int i = (1); i <= (n); i++) f[i] = 1;
  for (int i = (1); i <= (m); i++) {
    if (cur[i]) g[cur[i]] = f[u[i]] + f[v[i]];
    f[u[i]] = f[v[i]] = f[u[i]] + f[v[i]] - g[i];
  }
  for (int i = (1); i <= (n); i++) printf("%d ", f[i] - 1);
  puts("");
  return 0;
}
