#include <bits/stdc++.h>
using namespace std;
long long const MX = 2e4 + 10;
long long const inf = 1e9;
int res[MX];
vector<int> arr[MX];
int aa = 1;
bool cmp(int x, int y) {
  if (x > aa && y > aa) return x > y;
  if (x > aa && y < aa) return 0;
  if (x<aa, y> aa) return 1;
  if (x < aa && y < aa) return x > y;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    arr[x].push_back(y);
  }
  for (int i = 1; i <= n; i++) {
    sort(arr[i].begin(), arr[i].end(), cmp);
    aa++;
  }
  int rnd = 0, stat = 0;
  for (int i = 1; i <= n; i++) {
    int siz = arr[i].size();
    if (siz == 0) continue;
    int tmprnd = siz, tmpstat = arr[i][siz - 1];
    if (tmpstat < i) tmprnd++;
    if (tmprnd > rnd) {
      rnd = tmprnd;
      stat = tmpstat;
    } else if (tmprnd == rnd)
      stat = max(stat, tmpstat);
  }
  res[1] = rnd * n - 1 - (n - stat);
  for (int i = 2; i <= n; i++) {
    int siz = arr[i - 1].size();
    if (siz == 0) {
      res[i] = res[i - 1] - 1;
      continue;
    }
    int tmprnd = siz + 1, tmpstat = arr[i - 1][siz - 1];
    if (tmpstat < i) tmprnd++;
    if (tmprnd > rnd) {
      rnd = tmprnd;
      stat = tmpstat;
    } else if (tmprnd == rnd)
      stat = max(stat, tmpstat);
    res[i] = rnd * n - 1 - (n - stat) - (i - 1);
  }
  for (int i = 1; i <= n; i++) cout << res[i] << " ";
  return 0;
}
