#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2 * (int)1e5 + 4;
int n, m, t[10], x[MAXN], y[MAXN];
struct f {
  int up, down;
  f() { up = down = -1; }
} diag[MAXN], diag2[MAXN], hor[MAXN], vert[MAXN];
inline int get(const int& y, const int& x) {
  int res = 0;
  if (diag2[x + y].up < x && diag2[x + y].up != -1) res++;
  if (diag2[x + y].up != diag2[x + y].down && diag2[x + y].down != -1 &&
      diag2[x + y].down > x)
    res++;
  if (diag[(x - y + MAXN / 2)].up > x && diag[(x - y + MAXN / 2)].up != -1)
    res++;
  if (diag[(x - y + MAXN / 2)].up != diag[(x - y + MAXN / 2)].down &&
      diag[(x - y + MAXN / 2)].down != -1 && diag[(x - y + MAXN / 2)].down < x)
    res++;
  if (vert[x].up != -1 && vert[x].up > y) res++;
  if (vert[x].up != vert[x].down && vert[x].down != -1 && vert[x].down < y)
    res++;
  if (hor[y].up != -1 && hor[y].up > x) res++;
  if (hor[y].up != hor[y].down && hor[y].down != -1 && hor[y].down < x) res++;
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", y + i, x + i);
    if (diag2[x[i] + y[i]].up == -1 || diag2[x[i] + y[i]].up > x[i])
      diag2[x[i] + y[i]].up = x[i];
    if (diag2[x[i] + y[i]].down == -1 || diag2[x[i] + y[i]].down < x[i])
      diag2[x[i] + y[i]].down = x[i];
    if (diag[(x[i] - y[i] + MAXN / 2)].up == -1 ||
        diag[(x[i] - y[i] + MAXN / 2)].up < x[i])
      diag[(x[i] - y[i] + MAXN / 2)].up = x[i];
    if (diag[(x[i] - y[i] + MAXN / 2)].down == -1 ||
        diag[(x[i] - y[i] + MAXN / 2)].down > x[i])
      diag[(x[i] - y[i] + MAXN / 2)].down = x[i];
    if (vert[x[i]].up == -1 || vert[x[i]].up < y[i]) vert[x[i]].up = y[i];
    if (vert[x[i]].down == -1 || vert[x[i]].down > y[i]) vert[x[i]].down = y[i];
    if (hor[y[i]].up == -1 || hor[y[i]].up < x[i]) hor[y[i]].up = x[i];
    if (hor[y[i]].down == -1 || hor[y[i]].down > x[i]) hor[y[i]].down = x[i];
  }
  for (int i = 0; i < m; i++) {
    int ans = get(y[i], x[i]);
    t[ans]++;
  }
  for (int i = 0; i < 9; i++) printf("%d ", t[i]);
  return 0;
}
