#include <bits/stdc++.h>
const int MAXN = 1e5 + 5;
int c1[MAXN * 2][2], c2[MAXN * 2][2], c3[MAXN * 2][2], c4[MAXN * 2][2];
int ans[9], r[MAXN], c[MAXN], n, m;
void push(int x) {
  c1[r[x]][0] = std::min(c1[r[x]][0], c[x]);
  c1[r[x]][1] = std::max(c1[r[x]][1], c[x]);
  c2[c[x]][0] = std::min(c2[c[x]][0], r[x]);
  c2[c[x]][1] = std::max(c2[c[x]][1], r[x]);
  c3[r[x] + c[x]][0] = std::min(c3[r[x] + c[x]][0], c[x]);
  c3[r[x] + c[x]][1] = std::max(c3[r[x] + c[x]][1], c[x]);
  c4[r[x] - c[x] + n][0] = std::min(c4[r[x] - c[x] + n][0], c[x]);
  c4[r[x] - c[x] + n][1] = std::max(c4[r[x] - c[x] + n][1], c[x]);
}
void check(int x) {
  int cnt = 0;
  if (c1[r[x]][0] < c[x]) cnt++;
  if (c1[r[x]][1] > c[x]) cnt++;
  if (c2[c[x]][0] < r[x]) cnt++;
  if (c2[c[x]][1] > r[x]) cnt++;
  if (c3[r[x] + c[x]][0] < c[x]) cnt++;
  if (c3[r[x] + c[x]][1] > c[x]) cnt++;
  if (c4[r[x] - c[x] + n][0] < c[x]) cnt++;
  if (c4[r[x] - c[x] + n][1] > c[x]) cnt++;
  ans[cnt]++;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < 2 * MAXN; i++)
    c1[i][0] = c2[i][0] = c3[i][0] = c4[i][0] = 1e7;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", r + i, c + i);
    push(i);
  }
  for (int i = 1; i <= m; i++) check(i);
  for (int i = 0; i <= 8; i++) printf("%d%c", ans[i], " \n"[i == 8]);
  return 0;
}
