#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
int a[N];
int dp[N];
int dpe[N];
int n, m, k;
int h[N];
int e[N];
pair<int, int> ed[N];
vector<int> G[N];
void dfs(int u, int p) {
  dp[u] = 1, e[h[u] = k++] = p;
  for (auto x : G[u])
    if (x ^ p) {
      int v = ed[x].first ^ ed[x].second ^ u;
      if (!dp[v])
        dfs(v, x);
      else if (h[v] < h[u]) {
        bool ok = true;
        int prv = e[h[v]];
        e[h[v]] = x;
        int mn = min_element(e + h[v], e + h[u] + 1) - e;
        int mx = max_element(e + h[v], e + h[u] + 1) - e;
        for (int i = mn; i ^ mx; i = i++ < h[u] ? i : h[v])
          ok &= e[i] < e[i < h[u] ? i + 1 : h[v]];
        for (int i = mn; i ^ mx; i = i-- > h[v] ? i : h[u])
          ok &= e[i] < e[i > h[v] ? i - 1 : h[u]];
        if (ok) a[e[mn]] = e[mx];
        e[h[v]] = prv;
      }
    }
  k--;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; a[i++] = m) {
    int u, v;
    cin >> u >> v;
    ed[i] = {--u, --v};
    G[u].push_back(i);
    G[v].push_back(i);
  }
  dfs(0, -1);
  for (int i = m - 1; ~i; i--) {
    int u = ed[i].first, v = ed[i].second;
    dpe[i] = dp[u] += dp[v], dp[v] = dp[u] -= dpe[a[i]];
  }
  for (int u = 0; u < n; u++) {
    cout << --dp[u] << ' ';
  }
}
