#include <bits/stdc++.h>
using namespace std;
const int maxI = 1e5 + 50;
struct data {
  int x;
  int y;
} a[maxI];
int cnt[1000], n, m;
vector<int> row[maxI], col[maxI], dg1[maxI * 2], dg2[maxI * 2];
void get_sort() {
  for (int i = 0; i <= n; i++) {
    sort(row[i].begin(), row[i].end());
    sort(col[i].begin(), col[i].end());
  }
  for (int i = 0; i <= n * 2; i++) {
    sort(dg1[i].begin(), dg1[i].end());
    sort(dg2[i].begin(), dg2[i].end());
  }
}
int main(int argc, char const *argv[]) {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    row[x].push_back(y);
    col[y].push_back(x);
    dg1[x + y].push_back(x);
    dg2[x - y + n].push_back(y);
    a[i].x = x;
    a[i].y = y;
  }
  get_sort();
  for (int i = 0; i < m; i++) {
    int x = a[i].x, y = a[i].y;
    int atk = 8;
    if (y == row[x].front()) {
      atk--;
    }
    if (y == row[x].back()) {
      atk--;
    }
    if (x == col[y].front()) {
      atk--;
    }
    if (x == col[y].back()) {
      atk--;
    }
    if (x == dg1[x + y].front()) {
      atk--;
    }
    if (x == dg1[x + y].back()) {
      atk--;
    }
    if (y == dg2[x - y + n].front()) {
      atk--;
    }
    if (y == dg2[x - y + n].back()) {
      atk--;
    }
    cnt[atk]++;
  }
  for (int i = 0; i <= 8; i++) printf("%d ", cnt[i]);
  printf("\n");
  return 0;
}
