#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000;
int main() {
  int n, m, k, l;
  cin >> n >> m;
  vector<int> r[n + 1];
  vector<int> c[n + 1];
  vector<int> d[2 * n + 2];
  vector<int> d1[2 * n + 2];
  int minr[n + 1], minc[n + 1], mind[2 * n + 2], maxr[n + 1], maxc[n + 1],
      maxd[2 * n + 2], mind1[2 * n + 2], maxd1[2 * n + 2];
  int minrv[n + 1], mincv[n + 1], mindv[2 * n + 2], maxrv[n + 1], maxcv[n + 1],
      maxdv[2 * n + 2], mind1v[2 * n + 2], maxd1v[2 * n + 2];
  for (int i = (0); (i) < (n + 1); (i)++) {
    minr[i] = INF;
    minc[i] = INF;
    maxr[i] = -1;
    maxc[i] = -1;
  }
  for (int i = (0); (i) < (2 * n + 2); (i)++) {
    mind[i] = INF;
    mind1[i] = INF;
    maxd[i] = -1;
    maxd1[i] = -1;
  }
  for (int i = (0); (i) < (m); (i)++) {
    cin >> k >> l;
    r[k].push_back(i);
    c[l].push_back(i);
    d[k + l].push_back(i);
    d1[k - l + n].push_back(i);
    if (maxr[k] < l) {
      maxr[k] = l;
      maxrv[k] = i;
    }
    if (maxc[l] < k) {
      maxc[l] = k;
      maxcv[l] = i;
    }
    if (minr[k] > l) {
      minr[k] = l;
      minrv[k] = i;
    }
    if (minc[l] > k) {
      minc[l] = k;
      mincv[l] = i;
    }
    if (maxd[k + l] < l) {
      maxd[k + l] = l;
      maxdv[k + l] = i;
    }
    if (maxd1[k - l + n] < l) {
      maxd1[k - l + n] = l;
      maxd1v[k - l + n] = i;
    }
    if (mind[k + l] > l) {
      mind[k + l] = l;
      mindv[k + l] = i;
    }
    if (mind1[k - l + n] > l) {
      mind1[k - l + n] = l;
      mind1v[k - l + n] = i;
    }
  }
  vector<int> res(m + 1, 0);
  for (int i = (1); (i) < (n + 1); (i)++)
    if (r[i].size() > 1) {
      res[maxrv[i]]--;
      res[minrv[i]]--;
      for (int j = (0); (j) < (r[i].size()); (j)++) res[r[i][j]] += 2;
    }
  for (int i = (1); (i) < (n + 1); (i)++)
    if (c[i].size() > 1) {
      res[maxcv[i]]--;
      res[mincv[i]]--;
      for (int j = (0); (j) < (c[i].size()); (j)++) res[c[i][j]] += 2;
    }
  for (int i = (1); (i) < (2 * n + 2); (i)++)
    if (d[i].size() > 1) {
      res[maxdv[i]]--;
      res[mindv[i]]--;
      for (int j = (0); (j) < (d[i].size()); (j)++) res[d[i][j]] += 2;
    }
  for (int i = (1); (i) < (2 * n + 2); (i)++)
    if (d1[i].size() > 1) {
      res[maxd1v[i]]--;
      res[mind1v[i]]--;
      for (int j = (0); (j) < (d1[i].size()); (j)++) res[d1[i][j]] += 2;
    }
  int ans[10];
  memset(ans, 0, sizeof(ans));
  for (int i = (0); (i) < (m); (i)++) ans[res[i]]++;
  for (int i = (0); (i) < (9); (i)++) cout << ans[i] << ' ';
  return 0;
}
