#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(long long a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(long long a) {
  write(a);
  puts("");
}
inline void wri(long long a) {
  write(a);
  putchar(' ');
}
inline unsigned long long rnd() {
  return ((unsigned long long)rand() << 30 ^ rand()) << 4 | rand() % 4;
}
const int N = 500005;
vector<int> v[N];
map<int, int> M[N];
int jj[N], s[N], t[N], dfn[N], low[N], sta[N], ans[N], zygay[N], st, ti;
void solve(vector<int> v) {
  static int a[N];
  int n = v.size(), mx = 0, MX = 0, mn = 1e9, MN = 1e9;
  for (int i = (int)(0); i <= (int)(n - 1); i++) a[i] = M[v[i]][v[(i + 1) % n]];
  for (int i = (int)(0); i <= (int)(n - 1); i++) {
    if (a[i] > mx) {
      mx = a[i];
      MX = i;
    }
    if (a[i] < mn) {
      mn = a[i];
      MN = i;
    }
  }
  for (int i = MN; i != MX; i = (i + 1) % n) {
    if (a[i] > a[(i + 1) % n]) return;
  }
  for (int i = MX; i != MN; i = (i + 1) % n) {
    if (a[i] < a[(i + 1) % n]) return;
  }
  jj[a[MN]] = a[MX];
}
void dfs(int p, int fa) {
  dfn[p] = low[p] = ++ti;
  sta[++st] = p;
  for (auto i : v[p]) {
    if (i == fa) continue;
    if (!dfn[i]) {
      dfs(i, p);
      low[p] = min(low[p], low[i]);
      if (low[i] >= dfn[p]) {
        int x = 0;
        vector<int> jb;
        jb.push_back(p);
        while (x ^ i) {
          x = sta[st--];
          jb.push_back(x);
        }
        solve(jb);
      }
    } else
      low[p] = min(low[p], dfn[i]);
  }
}
int main() {
  int n = read(), m = read();
  for (int i = (int)(1); i <= (int)(m); i++) {
    s[i] = read();
    t[i] = read();
    v[s[i]].push_back(t[i]);
    v[t[i]].push_back(s[i]);
    M[s[i]][t[i]] = i;
    M[t[i]][s[i]] = i;
  }
  for (int i = (int)(1); i <= (int)(n); i++)
    if (!dfn[i]) dfs(i, 0);
  for (int i = (int)(1); i <= (int)(n); i++) ans[i] = 1;
  for (int i = (int)(m); i >= (int)(1); i--) {
    if (jj[i]) {
      ans[s[i]] -= zygay[jj[i]];
    }
    int sum = ans[s[i]] + ans[t[i]];
    zygay[i] += sum;
    ans[s[i]] = ans[t[i]] = sum;
  }
  for (int i = (int)(1); i <= (int)(n); i++) wri(ans[i] - 1);
}
