#include <bits/stdc++.h>
template <class T>
using pt = std::pair<T, T>;
using namespace std;
struct poledia {
  int lx, ly, rx, ry;
  int cnt = 0;
  poledia() : lx(- -1e9), ly(- -1e9), ry(-1e9), rx(-1e9){};
  poledia(bool is_dw) : lx(- -1e9), ly(-1e9), ry(- -1e9), rx(-1e9){};
};
struct poleos {
  int x1, y1, x2, y2;
  int cnt = 0;
  poleos() : x1(0), x2(0), y1(-1e9), y2(- -1e9){};
  poleos(bool is_vert) : x1(- -1e9), x2(-1e9), y1(0), y2(0){};
};
struct ferz {
  int x, y;
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<ferz> a(m);
  vector<poledia> diag1(2 * 1e5 + 1);
  vector<poledia> diag2(2 * 1e5 + 1);
  vector<poleos> ossx(1e5 + 1);
  vector<poleos> ossy(1e5 + 1);
  for (int i = 0; i < m; i++) {
    cin >> a[i].x >> a[i].y;
    int k = a[i].x + a[i].y - 1;
    if (diag1[k].cnt == 0) {
      diag1[k] = poledia(true);
    }
    diag1[k].lx = min(a[i].x, diag1[k].lx);
    diag1[k].ly = max(a[i].y, diag1[k].ly);
    diag1[k].rx = max(a[i].x, diag1[k].rx);
    diag1[k].ry = min(a[i].y, diag1[k].ry);
    diag1[k].cnt++;
    k = n - a[i].x + a[i].y;
    diag2[k].lx = min(diag2[k].lx, a[i].x);
    diag2[k].ly = min(diag2[k].ly, a[i].y);
    diag2[k].rx = max(diag2[k].rx, a[i].x);
    diag2[k].ry = max(diag2[k].ry, a[i].y);
    diag2[k].cnt++;
    k = a[i].y;
    if (ossx[k].cnt == 0) {
      ossx[k] = poleos(true);
    }
    ossx[k].x1 = min(ossx[k].x1, a[i].x);
    ossx[k].x2 = max(ossx[k].x2, a[i].x);
    ossx[k].cnt++;
    k = a[i].x;
    ossy[k].y1 = max(ossy[k].y1, a[i].y);
    ossy[k].y2 = min(ossy[k].y2, a[i].y);
    ossy[k].cnt++;
  }
  vector<int> ans(9);
  for (int i = 0; i < m; i++) {
    int sum = 0;
    int k1 = a[i].x + a[i].y - 1, k2 = n - a[i].x + a[i].y;
    if (diag1[k1].cnt != 1) {
      if (a[i].x == diag1[k1].lx && a[i].y == diag1[k1].ly ||
          a[i].x == diag1[k1].rx && a[i].y == diag1[k1].ry)
        sum++;
      else
        sum += 2;
    }
    if (diag2[k2].cnt != 1) {
      if (a[i].x == diag2[k2].lx && a[i].y == diag2[k2].ly ||
          a[i].x == diag2[k2].rx && a[i].y == diag2[k2].ry)
        sum++;
      else
        sum += 2;
    }
    if (ossx[a[i].y].cnt != 1) {
      if (a[i].x == ossx[a[i].y].x1 || a[i].x == ossx[a[i].y].x2)
        sum++;
      else
        sum += 2;
    }
    if (ossy[a[i].x].cnt != 1) {
      if (a[i].y == ossy[a[i].x].y1 || a[i].y == ossy[a[i].x].y2)
        sum++;
      else
        sum += 2;
    }
    ans[sum]++;
  }
  for (int i = 0; i < 9; i++) {
    cout << ans[i] << ' ';
  }
  return 0;
}
