#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
int n, m;
vector<pair<int, int> > g[maxn], e;
vector<int> loop[maxn];
int F[maxn], f[maxn];
int mn[maxn], id[maxn], pos[maxn], cnt;
int vis[maxn], st[maxn], top;
void dfs(int u, int f) {
  vis[u] = top;
  for (auto p : g[u]) {
    if (p.first == f) continue;
    st[top++] = p.second;
    if (vis[p.first] != -1) {
      ++cnt;
      mn[cnt] = m;
      for (int j = (top)-1; j >= (vis[p.first]); --j) {
        id[st[j]] = cnt;
        pos[st[j]] = loop[cnt].size();
        mn[cnt] = min(mn[cnt], st[j]);
        loop[cnt].push_back(st[j]);
      }
    } else
      dfs(p.first, u);
    --top;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  int u, v;
  for (int i = (0); i < (m); ++i) {
    scanf("%d%d", &u, &v);
    --u, --v;
    g[u].push_back(make_pair(v, i));
    g[v].push_back(make_pair(u, i));
    e.push_back(make_pair(u, v));
  }
  memset(vis, -1, sizeof(vis));
  memset(mn, 0x3f, sizeof(mn));
  dfs(0, 0);
  for (int i = (0); i < (n); ++i) f[i] = 1;
  for (int i = (m)-1; i >= (0); --i) {
    F[i] = f[e[i].first] + f[e[i].second];
    if (id[i] && i == mn[id[i]]) {
      int siz = loop[id[i]].size();
      int s = pos[i], t = pos[i];
      while (loop[id[i]][(s + 1) % siz] > loop[id[i]][s]) s = (s + 1) % siz;
      while (loop[id[i]][(t + siz - 1) % siz] > loop[id[i]][t])
        t = (t + siz - 1) % siz;
      if (s == t) F[i] -= F[loop[id[i]][s]];
    }
    f[e[i].first] = f[e[i].second] = F[i];
  }
  for (int i = (0); i < (n); ++i) printf("%d ", f[i] - 1);
  puts("");
}
