#include <bits/stdc++.h>
using namespace std;
void solvetask() {
  int n, m;
  cin >> n >> m;
  vector<int> r(m), c(m), t(9), w(m + 1);
  vector<pair<int, int>> a[n + 1][2], d[n * 2 + 1][2];
  for (int i = 0; i < m; i++) {
    cin >> r[i] >> c[i];
    a[r[i]][0].push_back({c[i], i});
    a[c[i]][1].push_back({r[i], i});
    d[r[i] + c[i]][0].push_back({c[i], i});
    d[r[i] - c[i] + n + 1][1].push_back({c[i], i});
  }
  for (int j = 0; j < 2; j++) {
    for (int i = 1; i <= n; i++) {
      if (a[i][j].size() >= 2) {
        sort(a[i][j].begin(), a[i][j].end());
        w[a[i][j][0].second]++;
        w[a[i][j].back().second]++;
        for (int k = 1; k < a[i][j].size() - 1; k++) w[a[i][j][k].second] += 2;
      }
    }
    for (int i = 1; i <= 2 * n; i++) {
      if (d[i][j].size() >= 2) {
        sort(d[i][j].begin(), d[i][j].end());
        w[d[i][j][0].second]++;
        w[d[i][j].back().second]++;
        for (int k = 1; k < d[i][j].size() - 1; k++) w[d[i][j][k].second] += 2;
      }
    }
  }
  for (int i = 0; i < m; i++) t[w[i]]++;
  for (int i = 0; i <= 8; i++) cout << t[i] << " ";
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) solvetask();
}
