#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int N = 100000;
int x[N], y[N];
int hmax[N], vmax[N], rmax[2 * N], lmax[2 * N];
int hmin[N], vmin[N], rmin[2 * N], lmin[2 * N];
int ans[9];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < (int)(n); i++) {
    hmax[i] = vmax[i] = -1;
    hmin[i] = vmin[i] = 999999999;
  }
  for (int i = 0; i < (int)(2 * n); i++) {
    rmax[i] = lmax[i] = -1;
    rmin[i] = lmin[i] = 999999999;
  }
  int xt, yt;
  for (int i = 0; i < (int)(m); i++) {
    scanf("%d %d", &xt, &yt);
    x[i] = --xt;
    y[i] = --yt;
    hmax[yt] = max(hmax[yt], xt);
    hmin[yt] = min(hmin[yt], xt);
    vmax[xt] = max(vmax[xt], yt);
    vmin[xt] = min(vmin[xt], yt);
    rmax[yt - xt + n] = max(rmax[yt - xt + n], xt);
    rmin[yt - xt + n] = min(rmin[yt - xt + n], xt);
    lmax[yt + xt] = max(lmax[yt + xt], xt);
    lmin[yt + xt] = min(lmin[yt + xt], xt);
  }
  memset(ans, 0, sizeof(ans));
  for (int i = 0; i < (int)(m); i++) {
    int cnt = 0;
    if (x[i] > hmin[y[i]]) ++cnt;
    if (x[i] < hmax[y[i]]) ++cnt;
    if (y[i] > vmin[x[i]]) ++cnt;
    if (y[i] < vmax[x[i]]) ++cnt;
    if (x[i] > rmin[y[i] - x[i] + n]) ++cnt;
    if (x[i] < rmax[y[i] - x[i] + n]) ++cnt;
    if (x[i] > lmin[y[i] + x[i]]) ++cnt;
    if (x[i] < lmax[y[i] + x[i]]) ++cnt;
    ans[cnt]++;
  }
  for (int i = 0; i < (int)(9); i++)
    printf("%d%c", ans[i], i == 8 ? '\n' : ' ');
  return 0;
}
