#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, r, c;
  scanf("%d %d", &n, &m);
  int moves[4][2][2 * n + 10];
  for (int i = 0; i < 4; ++i)
    for (int j = 0; j < 2; ++j)
      for (int k = 0; k < 2 * n + 10; ++k) moves[i][j][k] = (1 << 30);
  vector<pair<int, int> > v;
  for (int i = 0; i < m; ++i) {
    scanf("%d %d", &r, &c);
    v.push_back(make_pair(r, c));
    if (moves[0][0][r] == (1 << 30)) moves[0][0][r] = c;
    moves[0][0][r] = min(moves[0][0][r], c);
    if (moves[0][1][r] == (1 << 30)) moves[0][1][r] = c;
    moves[0][1][r] = max(moves[0][1][r], c);
    if (moves[1][0][c] == (1 << 30)) moves[1][0][c] = r;
    moves[1][0][c] = min(moves[1][0][c], r);
    if (moves[1][1][c] == (1 << 30)) moves[1][1][c] = r;
    moves[1][1][c] = max(moves[1][1][c], r);
    int du = r + c - 1;
    if (moves[2][0][du] == (1 << 30)) moves[2][0][du] = c;
    moves[2][0][du] = min(moves[2][0][du], c);
    if (moves[2][1][du] == (1 << 30)) moves[2][1][du] = c;
    moves[2][1][du] = max(moves[2][1][du], c);
    int dd = r - c + n;
    if (moves[3][0][dd] == (1 << 30)) moves[3][0][dd] = c;
    moves[3][0][dd] = min(moves[3][0][dd], c);
    if (moves[3][1][dd] == (1 << 30)) moves[3][1][dd] = c;
    moves[3][1][dd] = max(moves[3][1][dd], c);
  }
  int count[9];
  memset(count, 0, sizeof(count));
  for (int i = 0; i < m; ++i) {
    r = v[i].first;
    c = v[i].second;
    int du = r + c - 1;
    int dd = r - c + n;
    int cnt = 0;
    if (moves[0][0][r] < c) cnt++;
    if (moves[0][1][r] > c) cnt++;
    if (moves[1][0][c] < r) cnt++;
    if (moves[1][1][c] > r) cnt++;
    if (moves[2][0][du] < c) cnt++;
    if (moves[2][1][du] > c) cnt++;
    if (moves[3][0][dd] < c) cnt++;
    if (moves[3][1][dd] > c) cnt++;
    count[cnt]++;
  }
  for (int i = 0; i < 9; ++i) cout << count[i] << " ";
  cout << "\n";
  return 0;
}
