#include <bits/stdc++.h>
using namespace std;
inline char nc() {
  static char buf[100000], *l = buf, *r = buf;
  return l == r && (r = (l = buf) + fread(buf, 1, 100000, stdin), l == r)
             ? EOF
             : *l++;
}
template <class T>
void read(T &x) {
  x = 0;
  int f = 1, ch = nc();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = nc();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 - '0' + ch;
    ch = nc();
  }
  x *= f;
}
template <class T>
inline bool Cmax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
template <class T>
inline bool Cmin(T &x, T y) {
  return x > y ? x = y, 1 : 0;
}
const int inf = 1e9;
const int maxn = 500000 + 50;
const int maxm = 500000 + 50;
int m;
int n;
int dfc;
int a[maxm];
int b[maxm];
int e[maxm];
int f[maxm];
int dp[maxn];
int anc[maxn];
int dfn[maxn];
int pre[maxn];
int head[maxn];
struct edge {
  int to, nex, id;
  edge(int to = 0, int nex = 0, int id = 0) : to(to), nex(nex), id(id) {}
};
vector<edge> G;
inline void addedge(int u, int v, int id) {
  G.push_back(edge(v, head[u], id)), head[u] = G.size() - 1;
  G.push_back(edge(u, head[v], id)), head[v] = G.size() - 1;
}
namespace us {
int fa[maxn];
void init(int n) {
  for (int i = 1; i <= n; ++i) fa[i] = i;
}
int find(int a) { return a == fa[a] ? a : fa[a] = find(fa[a]); }
inline bool merge(int a, int b) {
  a = find(a), b = find(b);
  if (a == b) return 0;
  fa[a] = b;
  return 1;
}
}  // namespace us
void dfs(int u) {
  dfn[u] = ++dfc;
  for (int i = head[u]; ~i; i = G[i].nex) {
    int v = G[i].to;
    if (v == anc[u]) continue;
    if (!dfn[v]) {
      anc[v] = u;
      pre[v] = G[i].id;
      dfs(v);
    } else if (dfn[v] < dfn[u]) {
      vector<int> C;
      C.push_back(G[i].id);
      for (int x = u; x != v; x = anc[x]) {
        C.push_back(pre[x]);
      }
      int n = C.size();
      int mn = inf, mx = -inf, mxp, mnp;
      for (int i = 0; i < n; ++i) {
        if (Cmin(mn, C[i])) mnp = i;
        if (Cmax(mx, C[i])) mxp = i;
      }
      bool ok = 1;
      for (int i = mxp, j; i != mnp; i = j) {
        j = i == n - 1 ? 0 : i + 1;
        if (C[i] < C[j]) {
          ok = 0;
          break;
        }
      }
      for (int i = mxp, j; i != mnp; i = j) {
        j = i == 0 ? n - 1 : i - 1;
        if (C[i] < C[j]) {
          ok = 0;
          break;
        }
      }
      if (ok) e[mn] = mx;
    }
  }
}
int main() {
  read(n), read(m);
  memset(head, -1, sizeof(head));
  for (int i = 1; i <= m; ++i) {
    read(a[i]), read(b[i]);
    addedge(a[i], b[i], i);
  }
  dfs(1);
  us::init(n);
  for (int i = 1; i <= n; ++i) dp[i] = 1;
  for (int i = m; i >= 1; --i) {
    int re = dp[a[i]] + dp[b[i]];
    if (!us::merge(a[i], b[i])) {
      if (e[i]) re -= f[e[i]];
    }
    dp[a[i]] = dp[b[i]] = f[i] = re;
  }
  for (int i = 1; i <= n; ++i) {
    if (i != 1) printf(" ");
    printf("%d", dp[i] - 1);
  }
  printf("\n");
  return 0;
}
