#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100002;
int n, m, a[MAX_N][2];
set<int> x_axis[MAX_N], y_axis[MAX_N];
set<int> downL[2][MAX_N], downR[2][MAX_N];
int main() {
  while (cin >> n >> m) {
    for (int(i) = 0; (i) < (int)(MAX_N); ++(i)) {
      x_axis[i].clear();
      y_axis[i].clear();
      for (int(j) = 0; (j) < (int)(2); ++(j)) {
        downL[j][i].clear();
        downR[j][i].clear();
      }
    }
    for (int(i) = 0; (i) < (int)(m); ++(i)) {
      cin >> a[i][0] >> a[i][1];
      x_axis[a[i][1]].insert(a[i][0]);
      y_axis[a[i][0]].insert(a[i][1]);
      const int d = min(a[i][0], a[i][1]);
      const int r = a[i][0] - d, c = a[i][1] - d;
      if (c > r) {
        downL[0][c].insert(a[i][1]);
      } else {
        downL[1][r].insert(a[i][1]);
      }
      const int dd = a[i][1] + (a[i][0] - 1);
      if (dd <= n) {
        downR[0][dd].insert(a[i][1]);
      } else {
        downR[1][dd - n].insert(a[i][1]);
      }
    }
    vector<int> ans(9, 0);
    for (int(i) = 0; (i) < (int)(m); ++(i)) {
      int w = 0;
      const int r = a[i][0], c = a[i][1], dd = a[i][0] + (a[i][1] - 1);
      if (x_axis[c].upper_bound(r) != x_axis[c].end()) w++;
      if (x_axis[c].lower_bound(r) != x_axis[c].begin()) w++;
      if (y_axis[r].upper_bound(c) != y_axis[r].end()) w++;
      if (y_axis[r].lower_bound(c) != y_axis[r].begin()) w++;
      const int rr = r - min(r, c), cc = c - min(r, c);
      if (c > r) {
        if (downL[0][cc].upper_bound(c) != downL[0][cc].end()) w++;
        if (downL[0][cc].lower_bound(c) != downL[0][cc].begin()) w++;
      } else {
        if (downL[1][rr].upper_bound(c) != downL[1][rr].end()) w++;
        if (downL[1][rr].lower_bound(c) != downL[1][rr].begin()) w++;
      }
      if (dd <= n) {
        if (downR[0][dd].upper_bound(c) != downR[0][dd].end()) w++;
        if (downR[0][dd].lower_bound(c) != downR[0][dd].begin()) w++;
      } else {
        if (downR[1][dd - n].upper_bound(c) != downR[1][dd - n].end()) w++;
        if (downR[1][dd - n].lower_bound(c) != downR[1][dd - n].begin()) w++;
      }
      ans[w]++;
    }
    for (int(i) = 0; (i) < (int)(9); ++(i)) cout << ans[i] << " ";
    cout << endl;
  }
  return 0;
}
