#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool d = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') d = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return d ? x : -x;
}
inline void write(long long x) {
  if (x < 0) x = -x, putchar('-');
  if (x >= 10) write(x / 10);
  putchar('0' + x % 10);
}
inline void writeln(long long x) {
  write(x);
  puts("");
}
inline void writep(long long x) {
  write(x);
  putchar(' ');
}
inline unsigned long long rnd() {
  return ((unsigned long long)rand() << 30 ^ rand()) << 4 | rand() % 4;
}
const int N = 5e5 + 5;
int dep, dfn[N], low[N], head[N], opt, S[N], top;
struct info {
  int to, nxt;
} e[N << 1];
void add(int x, int y) {
  e[++opt] = (info){y, head[x]};
  head[x] = opt;
  e[++opt] = (info){x, head[y]};
  head[y] = opt;
}
map<int, int> M[N];
int id[N], ans[N], sum[N], x[N], y[N], a[N];
void solve(vector<int> v) {
  int n = v.size(), pmx = 0, pmn = 0;
  for (int i = (int)(0); i <= (int)(n - 1); i++) a[i] = M[v[i]][v[(i + 1) % n]];
  for (int i = (int)(1); i <= (int)(n - 1); i++) {
    if (a[i] > a[pmx]) pmx = i;
    if (a[i] < a[pmn]) pmn = i;
  }
  for (int i = pmn; i != pmx; i = (i + 1) % n) {
    if (a[i] > a[(i + 1) % n]) return;
  }
  for (int i = pmx; i != pmn; i = (i + 1) % n) {
    if (a[i] < a[(i + 1) % n]) return;
  }
  id[a[pmn]] = a[pmx];
}
void tarjan(int u, int fa) {
  dfn[u] = low[u] = ++dep;
  S[++top] = u;
  for (int i = head[u]; i; i = e[i].nxt) {
    int k = e[i].to;
    if (k == fa) continue;
    if (!dfn[k]) {
      tarjan(k, u);
      low[u] = min(low[u], low[k]);
      if (low[k] >= dfn[u]) {
        vector<int> v;
        v.push_back(u);
        int x = 0;
        while (x != k) x = S[top--], v.push_back(x);
        solve(v);
      }
    } else
      low[u] = min(low[u], dfn[k]);
  }
}
int main() {
  int n = read(), m = read();
  for (int i = (int)(1); i <= (int)(m); i++) {
    x[i] = read();
    y[i] = read();
    add(x[i], y[i]);
    M[x[i]][y[i]] = M[y[i]][x[i]] = i;
  }
  for (int i = (int)(1); i <= (int)(n); i++)
    if (!dfn[i]) tarjan(i, 0);
  for (int i = (int)(1); i <= (int)(n); i++) ans[i] = 1;
  for (int i = (int)(m); i >= (int)(1); i--) {
    if (id[i]) ans[x[i]] -= sum[id[i]];
    int ssw = ans[x[i]] + ans[y[i]];
    sum[i] += ssw;
    ans[x[i]] = ans[y[i]] = ssw;
  }
  for (int i = (int)(1); i <= (int)(n); i++) writep(ans[i] - 1);
}
