#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
int n, m, a[maxn], b[maxn], id_yal[maxn], id[maxn], h[maxn], dp[maxn], Dp[maxn],
    tmp, Par[maxn];
vector<pair<int, int> > v[maxn];
vector<int> dor[maxn], Tmp;
bool mark[maxn], e[maxn];
void dfs(int i, int j) {
  h[i] = h[j] + 1;
  Par[i] = j;
  e[id_yal[i]] = 1;
  mark[i] = 1;
  for (auto A : v[i]) {
    if (!mark[A.second]) id_yal[A.second] = A.first, dfs(A.second, i);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int y = 1; y <= m; y++) {
    id[y] = -1;
    cin >> a[y] >> b[y];
    v[a[y]].push_back(pair<int, int>(y, b[y]));
    v[b[y]].push_back(pair<int, int>(y, a[y]));
  }
  dfs(1, 0);
  for (int y = 1; y <= n; y++) {
    dp[y] = 1;
  }
  for (int y = 1; y <= m; y++) {
    if (!e[y]) {
      int i = a[y];
      int j = b[y];
      if (h[i] > h[j]) swap(i, j);
      dor[tmp].push_back(y);
      while (i != j) {
        dor[tmp].push_back(id_yal[j]);
        j = Par[j];
      }
      int mins = 0;
      for (int x = 0; x < dor[tmp].size(); x++)
        if (dor[tmp][x] < dor[tmp][mins]) mins = x;
      Tmp.clear();
      for (int x = mins; x < dor[tmp].size(); x++) Tmp.push_back(dor[tmp][x]);
      for (int x = 0; x < mins; x++) Tmp.push_back(dor[tmp][x]);
      dor[tmp] = Tmp;
      id[dor[tmp][0]] = tmp;
      tmp++;
    }
  }
  for (int y = m; y; y--) {
    Dp[y] = dp[a[y]] + dp[b[y]];
    if (id[y] + 1) {
      int po = id[y];
      int maxs = 0;
      for (int x = 0; x < dor[po].size(); x++)
        if (dor[po][maxs] < dor[po][x]) maxs = x;
      bool e = 0;
      for (int x = 1; x < maxs; x++)
        if (dor[po][x] < dor[po][x - 1]) e = 1;
      for (int x = maxs + 1; x < dor[po].size(); x++)
        if (dor[po][x] > dor[po][x - 1]) e = 1;
      if (!e) dp[a[y]] -= Dp[dor[po][maxs]];
    }
    dp[a[y]] = dp[b[y]] = dp[a[y]] + dp[b[y]];
  }
  for (int y = 1; y <= n; y++) cout << dp[y] - 1 << ' ';
}
