#include <bits/stdc++.h>
using namespace std;
int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, -1, 0, 1};
template <typename T>
ostream &operator<<(ostream &os, vector<T> &a) {
  copy(a.begin(), a.end(), ostream_iterator<T>(os, " "));
  os << endl;
  return os;
}
struct Queen {
  int x, y;
  int no;
  Queen(int x = 0, int y = 0, int n = 0) : x(x), y(y), no(n) {}
};
int n, m;
Queen q[100000];
int ans[100000];
int cnt[300000];
int now[300000];
struct comparer_x {
  bool operator()(const Queen &a, const Queen &b) {
    return a.x == b.x ? a.y < b.y : a.x < b.x;
  }
};
struct comparer_y {
  bool operator()(const Queen &a, const Queen &b) {
    return a.y == b.y ? a.x < b.x : a.y < b.y;
  }
};
void show() {
  for (int i = 0; i < (int)(m); i++) {
    cout << "(" << q[i].x << "," << q[i].y << ":" << q[i].no << ")"
         << " ";
  }
  cout << endl;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &q[i].x, &q[i].y);
    q[i].x--;
    q[i].y--;
    q[i].no = i;
  }
  for (int t = 0; t < 2; t++) {
    std::sort(q, q + m, comparer_x());
    memset(cnt, 0, sizeof(cnt));
    memset(now, 0, sizeof(now));
    for (int i = 0; i < (int)(m); i++) {
      cnt[q[i].x]++;
    }
    for (int i = 0; i < (int)(m); i++) {
      if (cnt[q[i].x] > 1) {
        if (now[q[i].x] == 0) {
          ans[q[i].no] += 1;
        } else if (now[q[i].x] == cnt[q[i].x] - 1) {
          ans[q[i].no] += 1;
        } else {
          ans[q[i].no] += 2;
        }
        now[q[i].x]++;
      }
    }
    std::sort(q, q + m, comparer_y());
    memset(cnt, 0, sizeof(cnt));
    memset(now, 0, sizeof(now));
    for (int i = 0; i < (int)(m); i++) {
      cnt[q[i].y]++;
    }
    for (int i = 0; i < (int)(m); i++) {
      if (cnt[q[i].y] > 1) {
        if (now[q[i].y] == 0) {
          ans[q[i].no] += 1;
        } else if (now[q[i].y] == cnt[q[i].y] - 1) {
          ans[q[i].no] += 1;
        } else {
          ans[q[i].no] += 2;
        }
        now[q[i].y]++;
      }
    }
    for (int i = 0; i < (int)(m); i++) {
      int tx = q[i].x, ty = q[i].y;
      q[i].x = tx + ty;
      q[i].y = tx - ty + n;
    }
  }
  int res[9];
  memset(res, 0, 9 * 4);
  for (int i = 0; i < (int)(m); i++) {
    res[ans[i]]++;
  }
  for (int i = 0; i < (int)(9); i++) {
    cout << res[i] << " ";
  }
  cout << endl;
  return 0;
}
