#include <bits/stdc++.h>
using namespace std;
vector<int> r[100005], c[100005], ld[200005], rd[200005];
int v[100005], out[10];
pair<int, int> p[100005];
bool cmpx(const int &a, const int &b) { return p[a].first < p[b].first; }
bool cmpy(const int &a, const int &b) { return p[a].second < p[b].second; }
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0, x, y; i < m; ++i) {
    cin >> x >> y;
    p[i] = make_pair(x, y);
    r[x].push_back(i);
    c[y].push_back(i);
    ld[x + y].push_back(i);
    rd[x - y + n].push_back(i);
  }
  for (int i = 1; i <= n; ++i) {
    if (r[i].size() >= 2) {
      sort(r[i].begin(), r[i].end(), cmpy);
      v[r[i][0]] |= 1;
      for (int j = 1; j < r[i].size() - 1; ++j) v[r[i][j]] |= 3;
      v[r[i][r[i].size() - 1]] |= 2;
    }
    if (c[i].size() >= 2) {
      sort(c[i].begin(), c[i].end(), cmpx);
      v[c[i][0]] |= 4;
      for (int j = 1; j < c[i].size() - 1; ++j) v[c[i][j]] |= 12;
      v[c[i][c[i].size() - 1]] |= 8;
    }
  }
  for (int i = 0; i <= 2 * n; ++i) {
    if (ld[i].size() >= 2) {
      sort(ld[i].begin(), ld[i].end(), cmpx);
      v[ld[i][0]] |= 16;
      for (int j = 1; j < ld[i].size() - 1; ++j) v[ld[i][j]] |= 48;
      v[ld[i][ld[i].size() - 1]] |= 32;
    }
    if (rd[i].size() >= 2) {
      sort(rd[i].begin(), rd[i].end(), cmpx);
      v[rd[i][0]] |= 64;
      for (int j = 1; j < rd[i].size() - 1; ++j) v[rd[i][j]] |= 192;
      v[rd[i][rd[i].size() - 1]] |= 128;
    }
  }
  for (int i = 0; i < m; ++i) {
    int cnt = 0;
    while (v[i]) {
      cnt += (v[i] & 1);
      v[i] >>= 1;
    }
    out[cnt]++;
  }
  for (int i = 0; i <= 8; ++i) cout << out[i] << " ";
  cout << endl;
  return 0;
}
