#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, m;
vector<int> r[4][N];
int xx[N], yy[N];
int main(void) {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &xx[i], &yy[i]);
    int x = xx[i], y = yy[i];
    r[0][x].push_back(y);
    r[1][y].push_back(x);
    r[2][x + y].push_back(x - y);
    r[3][x - y + n].push_back(x + y);
  }
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < N; j++) sort(r[i][j].begin(), r[i][j].end());
  int ans[9] = {};
  for (int i = 0; i < m; i++) {
    int x = xx[i], y = yy[i];
    int p = 0;
    vector<int>::iterator it;
    int t[4] = {x, y, x + y, x - y + n};
    int s[4] = {y, x, x - y, x + y};
    for (int j = 0; j < 4; j++) {
      it = lower_bound(r[j][t[j]].begin(), r[j][t[j]].end(), s[j]);
      if (++it != r[j][t[j]].end()) ++p;
      if (--it != r[j][t[j]].begin()) ++p;
    }
    ans[p]++;
  }
  for (int i = 0; i < 9; i++) printf("%d ", ans[i]);
  puts("");
  return 0;
}
