#include <bits/stdc++.h>
using namespace std;
using vint = vector<long long>;
using pint = pair<long long, long long>;
using vpint = vector<pint>;
template <typename A, typename B>
inline void chmin(A& a, B b) {
  if (a > b) a = b;
}
template <typename A, typename B>
inline void chmax(A& a, B b) {
  if (a < b) a = b;
}
template <class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>& p) {
  ost << "{" << p.first << "," << p.second << "}";
  return ost;
}
template <class T>
ostream& operator<<(ostream& ost, const vector<T>& v) {
  ost << "{";
  for (long long i = 0; i < v.size(); i++) {
    if (i) ost << ",";
    ost << v[i];
  }
  ost << "}";
  return ost;
}
struct UnionFindTree {
  vector<long long> par, sz;
  UnionFindTree(long long n) {
    par.resize(n);
    sz.resize(n);
    for (long long i = 0; i < n; i++) {
      par[i] = i;
      sz[i] = 1;
    }
  }
  long long find(long long x) {
    return x == par[x] ? x : par[x] = find(par[x]);
  }
  void unite(long long x, long long y) {
    x = find(x);
    y = find(y);
    if (x == y) return;
    if (sz[x] < sz[y]) swap(x, y);
    sz[x] += sz[y];
    par[y] = x;
  }
  bool areSame(long long x, long long y) { return find(x) == find(y); }
  long long size(long long x) { return sz[find(x)]; }
};
long long N, M;
long long A[555555], B[555555];
vpint T[555555];
long long parEdgeID[555555];
long long par[555555];
long long dep[555555];
void predfs(long long v, long long p, long long d) {
  dep[v] = d;
  par[v] = p;
  for (auto& e : T[v]) {
    if (e.first == p) continue;
    parEdgeID[e.first] = e.second;
    predfs(e.first, v, d + 1);
  }
}
long long info[555555];
long long dp[555555];
long long memA[555555], memB[555555];
signed main() {
  scanf("%lld%lld", &N, &M);
  UnionFindTree uf(N);
  fill_n(info, M, -1);
  vint lis;
  for (long long i = 0; i < (M); i++) {
    scanf("%lld%lld", &A[i], &B[i]);
    A[i]--;
    B[i]--;
    if (uf.areSame(A[i], B[i])) {
      lis.push_back(i);
      continue;
    }
    T[A[i]].emplace_back(B[i], i);
    T[B[i]].emplace_back(A[i], i);
    uf.unite(A[i], B[i]);
  }
  predfs(0, -1, 0);
  for (auto k : lis) {
    long long a = A[k], b = B[k];
    vint idA, idB, vsA{a}, vsB{b};
    while (a != b) {
      if (dep[a] >= dep[b]) {
        idA.push_back(parEdgeID[a]);
        a = par[a];
        vsA.push_back(a);
      } else {
        idB.push_back(parEdgeID[b]);
        b = par[b];
        vsB.push_back(b);
      }
    }
    vint id = idB;
    reverse((id).begin(), (id).end());
    id.insert(id.begin(), (idA).begin(), (idA).end());
    vint vs = vsB;
    vs.pop_back();
    reverse((vs).begin(), (vs).end());
    vs.insert(vs.begin(), (vsA).begin(), (vsA).end());
    long long m = min_element((id).begin(), (id).end()) - id.begin();
    bool ok = true;
    for (long long i = 0; i + 1 < m; i++)
      if (id[i] < id[i + 1]) ok = false;
    for (long long i = m; i + 1 < id.size(); i++)
      if (id[i] > id[i + 1]) ok = false;
    if (!ok) continue;
    info[id[m]] = k;
  }
  map<pint, long long> mem;
  for (long long i = 0; i < (N); i++) dp[i] = 1;
  for (long long i = M - 1; i >= 0; i--) {
    long long addA = dp[B[i]];
    long long addB = dp[A[i]];
    if (info[i] != -1) {
      long long k = info[i];
      long long tmp = memA[k] + memB[k];
      addA -= tmp;
      addB -= tmp;
    }
    memA[i] = dp[A[i]];
    memB[i] = dp[B[i]];
    dp[A[i]] += addA;
    dp[B[i]] += addB;
  }
  for (long long i = 0; i < (N); i++) dp[i]--;
  for (long long i = 0; i < (N); i++) {
    if (i) printf(" ");
    printf("%lld", dp[i]);
  }
  puts("");
  return 0;
}
