#include <bits/stdc++.h>
using namespace std;
int n, m;
bool vis[2 * 100009];
int cnt[10], ans[100009];
struct node {
  int x, y, id;
} p[100009];
bool cmp1(node a, node b) { return a.y < b.y; }
bool cmp2(node a, node b) { return a.x < b.x; }
bool cmp3(node a, node b) {
  if (a.x + a.y != b.x + b.y)
    return a.x + a.y < b.x + b.y;
  else
    return a.x > b.x;
}
int main() {
  cin >> m >> n;
  for (int i = 1; i <= n; i++) scanf("%d%d", &p[i].x, &p[i].y), p[i].id = i;
  sort(p + 1, p + 1 + n, cmp1);
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; i++) {
    if (vis[p[i].x])
      ans[p[i].id]++;
    else
      vis[p[i].x] = 1;
  }
  memset(vis, 0, sizeof(vis));
  for (int i = n; i >= 1; i--) {
    if (vis[p[i].x])
      ans[p[i].id]++;
    else
      vis[p[i].x] = 1;
  }
  sort(p + 1, p + 1 + n, cmp2);
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; i++) {
    if (vis[p[i].y])
      ans[p[i].id]++;
    else
      vis[p[i].y] = 1;
  }
  memset(vis, 0, sizeof(vis));
  for (int i = n; i >= 1; i--) {
    if (vis[p[i].y])
      ans[p[i].id]++;
    else
      vis[p[i].y] = 1;
  }
  sort(p + 1, p + 1 + n, cmp3);
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; i++) {
    if (vis[p[i].x + p[i].y])
      ans[p[i].id]++;
    else
      vis[p[i].x + p[i].y] = 1;
  }
  memset(vis, 0, sizeof(vis));
  for (int i = n; i >= 1; i--) {
    if (vis[p[i].x + p[i].y])
      ans[p[i].id]++;
    else
      vis[p[i].x + p[i].y] = 1;
  }
  for (int i = 1; i <= n; i++) {
    int nx = p[i].y;
    int ny = m + 1 - p[i].x;
    p[i].x = nx;
    p[i].y = ny;
  }
  sort(p + 1, p + 1 + n, cmp3);
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; i++) {
    if (vis[p[i].x + p[i].y])
      ans[p[i].id]++;
    else
      vis[p[i].x + p[i].y] = 1;
  }
  memset(vis, 0, sizeof(vis));
  for (int i = n; i >= 1; i--) {
    if (vis[p[i].x + p[i].y])
      ans[p[i].id]++;
    else
      vis[p[i].x + p[i].y] = 1;
  }
  for (int i = 1; i <= n; i++) cnt[ans[i]]++;
  for (int i = 0; i <= 8; i++) printf("%d%c", cnt[i], i == 8 ? '\n' : ' ');
  return 0;
}
