#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  set<int> row[n + 1], col[n + 1], diag_b[2 * n], diag_f[2 * n + 1];
  int ans[9] = {0};
  vector<pair<int, int> > queen(m);
  for (int i = 0; i < m; i++) {
    cin >> queen[i].first >> queen[i].second;
    row[queen[i].first].insert(queen[i].second);
    col[queen[i].second].insert(queen[i].first);
    diag_f[queen[i].first + queen[i].second].insert(queen[i].second);
    diag_b[queen[i].first - queen[i].second + n - 1].insert(queen[i].second);
  }
  for (auto a : queen) {
    int cnt = 0;
    set<int>::iterator it;
    it = row[a.first].lower_bound(a.second);
    if (row[a.first].size() > 1) {
      if (it == row[a.first].begin())
        cnt++;
      else if ((++it) == row[a.first].end())
        cnt++;
      else
        cnt += 2;
    }
    it = col[a.second].lower_bound(a.first);
    if (col[a.second].size() > 1) {
      if (it == col[a.second].begin())
        cnt++;
      else if ((++it) == col[a.second].end())
        cnt++;
      else
        cnt += 2;
    }
    it = diag_f[a.first + a.second].lower_bound(a.second);
    if (diag_f[a.first + a.second].size() > 1) {
      if (it == diag_f[a.first + a.second].begin())
        cnt++;
      else if ((++it) == diag_f[a.first + a.second].end())
        cnt++;
      else
        cnt += 2;
    }
    it = diag_b[a.first - a.second + n - 1].lower_bound(a.second);
    if (diag_b[a.first - a.second + n - 1].size() > 1) {
      if (it == diag_b[a.first - a.second + n - 1].begin())
        cnt++;
      else if ((++it) == diag_b[a.first - a.second + n - 1].end())
        cnt++;
      else
        cnt += 2;
    }
    ans[cnt]++;
  }
  for (int i = 0; i < 9; i++) cout << ans[i] << ' ';
}
