#include <bits/stdc++.h>
using namespace std;
int R[200005], C[200005];
vector<int> hor[200005], vert[200005], d1[200005], d2[200005];
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &R[i]);
    scanf("%d", &C[i]);
    hor[R[i]].push_back(C[i]);
    vert[C[i]].push_back(R[i]);
    d1[R[i] + C[i]].push_back(C[i]);
    d2[C[i] - R[i] + n].push_back(C[i]);
  }
  for (int i = 1; i <= 2 * n; i++) {
    if (hor[i].size()) sort(hor[i].begin(), hor[i].end());
    if (vert[i].size()) sort(vert[i].begin(), vert[i].end());
    if (d1[i].size()) sort(d1[i].begin(), d1[i].end());
    if (d2[i].size()) sort(d2[i].begin(), d2[i].end());
  }
  int t[9];
  memset(t, 0, sizeof(t));
  for (int i = 1; i <= m; i++) {
    int ans = 0;
    int r = R[i], c = C[i];
    if (hor[r].size() > 1) {
      ans++;
      if (hor[r][0] != c && hor[r][hor[r].size() - 1] != c) ans++;
    }
    if (vert[c].size() > 1) {
      ans++;
      if (vert[c][0] != r && vert[c][vert[c].size() - 1] != r) ans++;
    }
    if (d1[r + c].size() > 1) {
      ans++;
      if (d1[r + c][0] != c && d1[r + c][d1[r + c].size() - 1] != c) ans++;
    }
    if (d2[c - r + n].size() > 1) {
      ans++;
      if (d2[c - r + n][0] != c && d2[c - r + n][d2[c - r + n].size() - 1] != c)
        ans++;
    }
    t[ans]++;
  }
  for (int i = 0; i < 9; i++) cout << t[i] << " ";
}
