#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000;
struct Coord {
  int x;
  int y;
};
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > x(100001);
  vector<pair<int, int> > y(100001);
  vector<pair<int, int> > d1(200002);
  vector<pair<int, int> > d2(200002);
  for (int i = 0; i < 100001; i++) {
    x[i].first = 0;
    x[i].second = INF;
    y[i].first = 0;
    y[i].second = INF;
    d1[i].first = 0;
    d1[i].second = INF;
    d2[i].first = 0;
    d2[i].second = INF;
  }
  vector<Coord> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i].x >> a[i].y;
    if (x[a[i].x].first == 0) x[a[i].x].first = a[i].y;
    if (x[a[i].x].second == INF) x[a[i].x].second = a[i].y;
    x[a[i].x].first = min(x[a[i].x].first, a[i].y);
    x[a[i].x].second = max(x[a[i].x].second, a[i].y);
    if (y[a[i].y].first == 0) y[a[i].y].first = a[i].x;
    if (y[a[i].y].second == INF) y[a[i].y].second = a[i].x;
    y[a[i].y].first = min(y[a[i].y].first, a[i].x);
    y[a[i].y].second = max(y[a[i].y].second, a[i].x);
    if (d1[a[i].x + a[i].y - 1].first == 0)
      d1[a[i].x + a[i].y - 1].first = a[i].y;
    if (d1[a[i].x + a[i].y - 1].second == INF)
      d1[a[i].x + a[i].y - 1].second = a[i].y;
    d1[a[i].x + a[i].y - 1].first = min(d1[a[i].x + a[i].y - 1].first, a[i].y);
    d1[a[i].x + a[i].y - 1].second =
        max(d1[a[i].x + a[i].y - 1].second, a[i].y);
    if (d2[n - a[i].x + a[i].y].first == 0)
      d2[n - a[i].x + a[i].y].first = a[i].y;
    if (d2[n - a[i].x + a[i].y].second == INF)
      d2[n - a[i].x + a[i].y].second = a[i].y;
    d2[n - a[i].x + a[i].y].first = min(d2[n - a[i].x + a[i].y].first, a[i].y);
    d2[n - a[i].x + a[i].y].second =
        max(d2[n - a[i].x + a[i].y].second, a[i].y);
  }
  vector<int> res(10);
  for (int i = 0; i < m; i++) {
    int cur = 0;
    if (a[i].y > x[a[i].x].first && x[a[i].x].first != 0) cur++;
    if (a[i].y < x[a[i].x].second && x[a[i].x].second != INF) cur++;
    if (a[i].x > y[a[i].y].first && y[a[i].y].first != 0) cur++;
    if (a[i].x < y[a[i].y].second && y[a[i].y].second != INF) cur++;
    if (a[i].y > d1[a[i].x + a[i].y - 1].first &&
        d1[a[i].x + a[i].y - 1].first != 0)
      cur++;
    if (a[i].y < d1[a[i].x + a[i].y - 1].second &&
        d1[a[i].x + a[i].y - 1].second != INF)
      cur++;
    if (a[i].y > d2[n - a[i].x + a[i].y].first &&
        d2[n - a[i].x + a[i].y].first != 0)
      cur++;
    if (a[i].y < d2[n - a[i].x + a[i].y].second &&
        d2[n - a[i].x + a[i].y].second != INF)
      cur++;
    res[cur]++;
  }
  for (int i = 0; i <= 8; i++) {
    cout << res[i] << " ";
  }
}
