#include <bits/stdc++.h>
using namespace std;
template <class t, class u>
void chmax(t &first, u second) {
  if (first < second) first = second;
}
template <class t, class u>
void chmin(t &first, u second) {
  if (second < first) first = second;
}
vector<int> Q;
const int offset = 1e5 + 1;
vector<pair<int, int> > queens;
int binary_search_lower(int r, vector<pair<int, int> > &v) {
  int lo = 0, hi = int(v.size()) - 1;
  bool ok1 = 0;
  while (lo < hi - 1) {
    int mi = lo + (hi - lo) / 2;
    if (v[mi].first < r)
      lo = mi;
    else
      hi = mi;
  }
  return (v[lo].first < r);
}
int binary_search_higher(int r, vector<pair<int, int> > &v) {
  int lo = 0, hi = int(v.size()) - 1;
  while (lo < hi - 1) {
    int mi = lo + (hi - lo) / 2;
    if (v[mi].first <= r)
      lo = mi;
    else
      hi = mi;
  }
  return (v[hi].first > r);
}
int binary_search_right(int c, vector<pair<int, int> > &v) {
  int lo = 0, hi = int(v.size()) - 1;
  while (lo < hi - 1) {
    int mi = lo + (hi - lo) / 2;
    if (v[mi].second <= c)
      lo = mi;
    else
      hi = mi;
  }
  return (v[hi].second > c);
}
int binary_search_left(int c, vector<pair<int, int> > &v) {
  int lo = 0, hi = int(v.size()) - 1;
  while (lo < hi - 1) {
    int mi = lo + (hi - lo) / 2;
    if (v[mi].second < c)
      lo = mi;
    else
      hi = mi;
  }
  return (v[lo].second < c);
}
map<pair<int, int>, int> Mp;
void mark(int x, int y, vector<vector<pair<int, int> > > &v, int axis = 1) {
  for (int rep = x; rep < y + 1; ++rep) {
    sort(v[rep + offset].begin(), v[rep + offset].end());
    for (auto &p : v[rep + offset]) {
      int r = p.first, c = p.second;
      int in = Mp[make_pair(r, c)];
      if (binary_search_lower(r, v[rep + offset])) Q[in]++;
      if (binary_search_higher(r, v[rep + offset])) Q[in]++;
      if (axis == 0 && binary_search_left(c, v[rep + offset])) {
        Q[in]++;
      }
      if (axis == 0 && binary_search_right(c, v[rep + offset])) {
        Q[in]++;
      }
    }
  }
}
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  Q.assign(m, 0);
  queens.resize(m);
  vector<vector<pair<int, int> > > d1, d2, X, Y;
  X.resize(offset + n + 1);
  Y.resize(offset + n + 1);
  d1.resize(offset + 2 * n + 1);
  d2.resize(offset + 2 * n + 1);
  for (int rep = 0; rep < m; ++rep) {
    int r, c;
    scanf("%d", &r);
    scanf("%d", &c);
    queens.emplace_back(make_pair(r, c));
    X[r + offset].push_back(make_pair(r, c));
    Y[c + offset].push_back(make_pair(r, c));
    d1[r + c + offset].push_back(make_pair(r, c));
    d2[c - r + offset].push_back(make_pair(r, c));
    Mp[make_pair(r, c)] = rep;
  }
  mark(1, n, X, 0);
  mark(1, n, Y);
  mark(2, 2 * n, d1);
  mark(-1 * n + 1, n - 1, d2);
  vector<int> inv(9, 0);
  for (int rep = 0; rep < m; ++rep) {
    assert(Q[rep] < 9);
    inv[Q[rep]]++;
  }
  for (int rep = 0; rep < 9; ++rep) printf("%d ", inv[rep]);
  printf("\n");
  return 0;
}
