#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1E-9;
const int INF = (int)1E9;
const long long INF64 = (long long)1E18;
const long double PI = 2 * acos(.0);
int queens[100005][2];
map<pair<int, int>, int> points;
vector<int> gr1[100005];
vector<pair<int, int> > gr2[2 * 100005];
vector<int> ind;
int main() {
  int n, m, x, y;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (int)(m); i++)
    scanf("%d%d", &queens[i][0], &queens[i][1]);
  for (int i = 0; i < (int)(m); i++) {
    if ((gr1[queens[i][0]]).size() == 0) ind.push_back(queens[i][0]);
    gr1[queens[i][0]].push_back(queens[i][1]);
  }
  for (int i = 0; i < (int)((ind).size()); i++) {
    if ((gr1[ind[i]]).size() == 1) {
    } else {
      int ini = *min_element(gr1[ind[i]].begin(), gr1[ind[i]].end());
      int fin = *max_element(gr1[ind[i]].begin(), gr1[ind[i]].end());
      points[make_pair(ind[i], ini)] = points[make_pair(ind[i], ini)] + 1;
      points[make_pair(ind[i], fin)] = points[make_pair(ind[i], fin)] + 1;
      for (int j = 0; j < (int)((gr1[ind[i]]).size()); j++) {
        if (gr1[ind[i]][j] == ini || gr1[ind[i]][j] == fin) continue;
        points[make_pair(ind[i], gr1[ind[i]][j])] =
            points[make_pair(ind[i], gr1[ind[i]][j])] + 2;
      }
    }
    gr1[ind[i]].clear();
  }
  ind.clear();
  for (int i = 0; i < (int)(m); i++) {
    if ((gr1[queens[i][1]]).size() == 0) ind.push_back(queens[i][1]);
    gr1[queens[i][1]].push_back(queens[i][0]);
  }
  for (int i = 0; i < (int)((ind).size()); i++) {
    if ((gr1[ind[i]]).size() == 1) {
    } else {
      int ini = *min_element(gr1[ind[i]].begin(), gr1[ind[i]].end());
      int fin = *max_element(gr1[ind[i]].begin(), gr1[ind[i]].end());
      points[make_pair(ini, ind[i])] = points[make_pair(ini, ind[i])] + 1;
      points[make_pair(fin, ind[i])] = points[make_pair(fin, ind[i])] + 1;
      for (int j = 0; j < (int)((gr1[ind[i]]).size()); j++) {
        if (gr1[ind[i]][j] == ini || gr1[ind[i]][j] == fin) continue;
        points[make_pair(gr1[ind[i]][j], ind[i])] =
            points[make_pair(gr1[ind[i]][j], ind[i])] + 2;
      }
    }
    gr1[ind[i]].clear();
  }
  ind.clear();
  for (int i = 0; i < (int)(m); i++) {
    int rect = queens[i][1] + queens[i][0];
    if ((gr2[rect]).size() == 0) ind.push_back(rect);
    gr2[rect].push_back(make_pair(queens[i][0], queens[i][1]));
  }
  for (int i = 0; i < (int)((ind).size()); i++) {
    if ((gr2[ind[i]]).size() == 1) {
    } else {
      pair<int, int> ini = *min_element(gr2[ind[i]].begin(), gr2[ind[i]].end());
      pair<int, int> fin = *max_element(gr2[ind[i]].begin(), gr2[ind[i]].end());
      points[ini] = points[ini] + 1;
      points[fin] = points[fin] + 1;
      for (int j = 0; j < (int)((gr2[ind[i]]).size()); j++) {
        if (gr2[ind[i]][j] == ini || gr2[ind[i]][j] == fin) continue;
        points[gr2[ind[i]][j]] = points[gr2[ind[i]][j]] + 2;
      }
    }
    gr2[ind[i]].clear();
  }
  ind.clear();
  for (int i = 0; i < (int)(m); i++) {
    int rect = queens[i][1] - queens[i][0] + 100005 - 5;
    if ((gr2[rect]).size() == 0) ind.push_back(rect);
    gr2[rect].push_back(make_pair(queens[i][0], queens[i][1]));
  }
  for (int i = 0; i < (int)((ind).size()); i++) {
    if ((gr2[ind[i]]).size() == 1) {
    } else {
      pair<int, int> ini = *min_element(gr2[ind[i]].begin(), gr2[ind[i]].end());
      pair<int, int> fin = *max_element(gr2[ind[i]].begin(), gr2[ind[i]].end());
      points[ini] = points[ini] + 1;
      points[fin] = points[fin] + 1;
      for (int j = 0; j < (int)((gr2[ind[i]]).size()); j++) {
        if (gr2[ind[i]][j] == ini || gr2[ind[i]][j] == fin) continue;
        points[gr2[ind[i]][j]] = points[gr2[ind[i]][j]] + 2;
      }
    }
    gr2[ind[i]].clear();
  }
  int resp[10];
  fill(resp, resp + 10, 0);
  for (int i = 0; i < (int)(m); i++) {
    resp[points[make_pair(queens[i][0], queens[i][1])]]++;
  }
  for (int i = 0; i < (int)(8); i++) cout << resp[i] << " ";
  cout << resp[8] << endl;
  return 0;
}
