#include <bits/stdc++.h>
using namespace std;
const int N = 100008;
int main() {
  int n, m;
  cin >> n >> m;
  int r[N], c[N];
  int t1[4][N], t2[4][N], g1[2][N], g2[2][N];
  memset(g1, 0, sizeof(g1));
  memset(g2, 0, sizeof(g2));
  memset(t1, 0, sizeof(t1));
  memset(t2, 0, sizeof(t2));
  for (int i = 1; i <= m; ++i) {
    cin >> r[i] >> c[i];
    r[i]--;
    c[i]--;
    int ind, d;
    if (r[i] < c[i]) {
      ind = 0;
      d = c[i] - r[i];
    } else {
      ind = 1;
      d = r[i] - c[i];
    }
    if (t1[ind][d] == 0 || r[i] < r[t1[ind][d]]) t1[ind][d] = i;
    if (t2[ind][d] == 0 || r[i] > r[t2[ind][d]]) t2[ind][d] = i;
    if (t1[2][r[i]] == 0 || c[i] < c[t1[2][r[i]]]) t1[2][r[i]] = i;
    if (t2[2][r[i]] == 0 || c[i] > c[t2[2][r[i]]]) t2[2][r[i]] = i;
    if (t1[3][c[i]] == 0 || r[i] < r[t1[3][c[i]]]) t1[3][c[i]] = i;
    if (t2[3][c[i]] == 0 || r[i] > r[t2[3][c[i]]]) t2[3][c[i]] = i;
    if (r[i] < n - c[i] - 1) {
      ind = 0;
      d = c[i] + r[i];
    } else {
      ind = 1;
      d = r[i] - (n - c[i] - 1);
    }
    if (g1[ind][d] == 0 || r[i] < r[g1[ind][d]]) g1[ind][d] = i;
    if (g2[ind][d] == 0 || r[i] > r[g2[ind][d]]) g2[ind][d] = i;
  }
  int res[9];
  memset(res, 0, sizeof(res));
  for (int i = 1; i <= m; ++i) {
    int cnt = 0;
    int ind, d;
    if (r[i] < c[i]) {
      ind = 0;
      d = c[i] - r[i];
    } else {
      ind = 1;
      d = r[i] - c[i];
    }
    if (t1[ind][d] != i) cnt++;
    if (t2[ind][d] != i) cnt++;
    if (t1[2][r[i]] != i) cnt++;
    if (t2[2][r[i]] != i) cnt++;
    if (t1[3][c[i]] != i) cnt++;
    if (t2[3][c[i]] != i) cnt++;
    if (r[i] < n - c[i] - 1) {
      ind = 0;
      d = c[i] + r[i];
    } else {
      ind = 1;
      d = r[i] - (n - c[i] - 1);
    }
    if (g1[ind][d] != i) cnt++;
    if (g2[ind][d] != i) cnt++;
    res[cnt]++;
  }
  cout << res[0];
  for (int i = 1; i < 9; ++i) cout << ' ' << res[i];
}
