#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
int n, m, f[N];
int pp = 1, lnk[N], nxt[N * 2], to[N * 2];
void ae(int k1, int k2) { to[++pp] = k2, nxt[pp] = lnk[k1], lnk[k1] = pp; }
int st[N], top, dfn[N], low[N], ind, pre[N], goes[N], offset[N];
map<pair<int, int>, int> Eid;
void tarjan(int k1, int k2) {
  st[++top] = k1, dfn[k1] = low[k1] = ++ind;
  for (int i = lnk[k1]; i; i = nxt[i])
    if (i / 2 != k2 / 2) {
      if (!dfn[to[i]]) {
        pre[to[i]] = i;
        tarjan(to[i], i), low[k1] = min(low[k1], low[to[i]]);
        if (low[to[i]] >= dfn[k1]) {
          vector<int> cyc;
          cyc.push_back(Eid[{st[top], k1}]);
          do {
            cyc.push_back(pre[st[top]]);
          } while (st[top--] != to[i]);
          rotate(cyc.begin(), min_element(cyc.begin(), cyc.end()), cyc.end());
          int pos = max_element(cyc.begin(), cyc.end()) - cyc.begin();
          bool ok = 1;
          for (int i = (0); i <= (pos - 1); ++i) {
            if (cyc[i] > cyc[i + 1]) ok = 0;
          }
          for (int i = (pos); i <= (((int)(cyc).size()) - 2); ++i)
            if (cyc[i] < cyc[i + 1]) ok = 0;
          if (ok) {
            goes[cyc[pos] / 2] = cyc[0] / 2;
          }
        }
      } else {
        low[k1] = min(low[k1], dfn[to[i]]);
      }
    }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (1); i <= (m); ++i) {
    int k1, k2;
    scanf("%d%d", &k1, &k2);
    ae(k1, k2), ae(k2, k1);
    Eid[{k1, k2}] = i * 2;
    Eid[{k2, k1}] = i * 2 + 1;
  }
  tarjan(1, 0);
  for (int i = (1); i <= (n); ++i) f[i] = 1;
  for (int i = (m); i >= (1); --i) {
    int k1 = to[i * 2 + 1], k2 = to[i * 2];
    int w = f[k1] + f[k2] - offset[i];
    f[k1] = f[k2] = w;
    if (goes[i]) {
      offset[goes[i]] = w;
    }
  }
  for (int i = (1); i <= (n); ++i) printf("%d ", f[i] - 1);
  puts("");
  return 0;
}
