#include <bits/stdc++.h>
using namespace std;
double PI = 3.141592653589793238462643383279;
const double EPS = 1e-9;
const long long MOD = 998244353;
const int inf = 1 << 30;
const long long linf = 1LL << 60;
struct CACTUS {
  vector<vector<int>> G;
  int cn;
  vector<vector<int>> cs;
  vector<int> saw, par, dep;
  void init(int n) {
    G.resize(n);
    saw.resize(n);
    par.resize(n);
    dep.resize(n);
    cn = 0;
  }
  void init(int n, vector<vector<int>>& _G) {
    G = _G;
    saw.resize(n);
    par.resize(n);
    dep.resize(n);
    cn = 0;
  }
  void add_edge(int u, int v) {
    G[u].push_back(v);
    G[v].push_back(u);
  }
  void dfs(int v) {
    saw[v] = 1;
    for (int to : G[v]) {
      if (!saw[to]) {
        par[to] = v;
        dep[to] = dep[v] + 1;
        dfs(to);
      } else if (dep[to] < dep[v]) {
        int now = v;
        vector<int> cir;
        while (true) {
          now = par[now];
          cir.push_back(now);
          if (now == to) break;
        }
        cir.push_back(v);
        cs.push_back(cir);
      }
    }
  }
  void build(int root = 0) { dfs(root); }
};
int n, m;
CACTUS cac;
vector<int> A, B;
vector<vector<int>> e;
map<pair<int, int>, int> w, hoge;
int val[500001];
int ans[500001];
int main() {
  scanf("%d%d", &n, &m);
  e.resize(n);
  A.resize(m);
  B.resize(m);
  for (int i = 0; i < (int)m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--;
    v--;
    A[i] = u;
    B[i] = v;
    e[u].push_back(v);
    e[v].push_back(u);
    w[pair<int, int>(u, v)] = i;
    w[pair<int, int>(v, u)] = i;
  }
  cac.init(n, e);
  cac.build();
  for (auto& vec : cac.cs) {
    if (vec.size() == 2) continue;
    int M = -1, Mpos;
    int m = inf, mpos;
    int si = vec.size();
    for (int i = 0; i < (int)vec.size(); i++) {
      int j = (i + 1) % si;
      int nw = w[pair<int, int>(vec[i], vec[j])];
      if (M < nw) {
        M = nw;
        Mpos = i;
      }
      if (m > nw) {
        m = nw;
        mpos = i;
      }
    }
    int from = Mpos;
    int to = (mpos + 1) % si;
    int nm = M;
    bool ok = false;
    while (true) {
      if (from == to) {
        ok = true;
        break;
      }
      int x = (from - 1 + si) % si;
      int nw = w[pair<int, int>(vec[x], vec[from])];
      if (nw < nm) {
        nm = nw;
        from = x;
      } else
        break;
    }
    if (!ok) continue;
    from = (Mpos + 1) % si;
    to = mpos;
    nm = M;
    ok = false;
    while (true) {
      if (from == to) {
        ok = true;
        break;
      }
      int x = (from + 1) % si;
      int nw = w[pair<int, int>(vec[x], vec[from])];
      if (nw < nm) {
        nm = nw;
        from = x;
      } else
        break;
    }
    if (!ok) continue;
    hoge[pair<int, int>(vec[mpos], vec[(mpos + 1) % si])] = M;
    hoge[pair<int, int>(vec[(mpos + 1) % si], vec[mpos])] = M;
  }
  for (int i = 0; i < (int)n; i++) ans[i] = 1;
  for (int i = m - 1; i >= 0; i--) {
    int x = ans[A[i]] + ans[B[i]];
    val[i] = x;
    if (hoge.count(pair<int, int>(A[i], B[i]))) {
      int t = hoge[pair<int, int>(A[i], B[i])];
      val[i] -= val[t];
    }
    ans[A[i]] = val[i];
    ans[B[i]] = val[i];
  }
  for (int i = 0; i < (int)n; i++) printf("%d ", ans[i] - 1);
  puts("");
}
