#include <bits/stdc++.h>
using namespace std;
const int big = 1000000;
int n, m, x[100002], y[100002];
int rowmin[100002], rowmax[100002], columnmin[100002], columnmax[100002],
    summax[200002], summin[200002], rismin[200002], rismax[2000002];
int main() {
  int t[10];
  cin >> n >> m;
  memset(t, 0, sizeof(t));
  for (int i = 1; i <= n; i++) {
    rowmin[i] = big;
    rowmax[i] = -1;
    columnmin[i] = big;
    columnmax[i] = -1;
  }
  for (int i = 0; i <= n + n; i++) {
    summin[i] = big;
    summax[i] = -1;
    rismin[i] = big;
    rismax[i] = -1;
  }
  for (int i = 1; i <= m; i++) {
    cin >> x[i] >> y[i];
    rowmin[x[i]] = min(rowmin[x[i]], y[i]);
    rowmax[x[i]] = max(rowmax[x[i]], y[i]);
    summin[x[i] + y[i]] = min(summin[x[i] + y[i]], x[i]);
    summax[x[i] + y[i]] = max(summax[x[i] + y[i]], x[i]);
    rismin[x[i] - y[i] + n] = min(rismin[x[i] - y[i] + n], x[i]);
    rismax[x[i] - y[i] + n] = max(rismax[x[i] - y[i] + n], x[i]);
    columnmin[y[i]] = min(columnmin[y[i]], x[i]);
    columnmax[y[i]] = max(columnmax[y[i]], x[i]);
  }
  for (int i = 1; i <= m; i++) {
    int r = 0;
    if (rowmin[x[i]] < y[i]) r++;
    if (rowmax[x[i]] > y[i]) r++;
    if (columnmin[y[i]] < x[i]) r++;
    if (columnmax[y[i]] > x[i]) r++;
    if (summin[x[i] + y[i]] < x[i]) r++;
    if (summax[x[i] + y[i]] > x[i]) r++;
    if (rismin[x[i] - y[i] + n] < x[i]) r++;
    if (rismax[x[i] - y[i] + n] > x[i]) r++;
    t[r]++;
  }
  for (int i = 0; i <= 8; i++) cout << t[i] << " ";
  cout << endl;
  return 0;
}
