#include <bits/stdc++.h>
using namespace std;
const int MAX = 400100;
int n, m;
int d[4][2][MAX], r[MAX], c[MAX];
int ans[10];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < int(m); i++) {
    scanf("%d %d", r + i, c + i);
    d[0][1][c[i]] = (d[0][1][c[i]] == 0 ? r[i] : max(r[i], d[0][1][c[i]]));
    d[0][0][c[i]] = (d[0][0][c[i]] == 0 ? r[i] : min(r[i], d[0][0][c[i]]));
    d[1][1][c[i] - r[i] + n] =
        (d[1][1][c[i] - r[i] + n] == 0 ? r[i]
                                       : max(r[i], d[1][1][c[i] - r[i] + n]));
    d[1][0][c[i] - r[i] + n] =
        (d[1][0][c[i] - r[i] + n] == 0 ? r[i]
                                       : min(r[i], d[1][0][c[i] - r[i] + n]));
    d[2][1][r[i]] = (d[2][1][r[i]] == 0 ? c[i] : max(c[i], d[2][1][r[i]]));
    d[2][0][r[i]] = (d[2][0][r[i]] == 0 ? c[i] : min(c[i], d[2][0][r[i]]));
    d[3][1][c[i] + r[i]] =
        (d[3][1][c[i] + r[i]] == 0 ? c[i] : max(c[i], d[3][1][c[i] + r[i]]));
    d[3][0][c[i] + r[i]] =
        (d[3][0][c[i] + r[i]] == 0 ? c[i] : min(c[i], d[3][0][c[i] + r[i]]));
  }
  for (int i = 0; i < int(m); i++) {
    int cnt = 0;
    if (d[0][1][c[i]] == r[i] && d[0][0][c[i]] == r[i])
      ;
    else if (d[0][1][c[i]] == r[i] || d[0][0][c[i]] == r[i])
      cnt++;
    else
      cnt += 2;
    if (d[1][1][c[i] - r[i] + n] == r[i] && d[1][0][c[i] - r[i] + n] == r[i])
      ;
    else if (d[1][1][c[i] - r[i] + n] == r[i] ||
             d[1][0][c[i] - r[i] + n] == r[i])
      cnt++;
    else
      cnt += 2;
    if (d[2][1][r[i]] == c[i] && d[2][0][r[i]] == c[i])
      ;
    else if (d[2][1][r[i]] == c[i] || d[2][0][r[i]] == c[i])
      cnt++;
    else
      cnt += 2;
    if (d[3][1][c[i] + r[i]] == c[i] && d[3][0][c[i] + r[i]] == c[i])
      ;
    else if (d[3][1][c[i] + r[i]] == c[i] || d[3][0][c[i] + r[i]] == c[i])
      cnt++;
    else
      cnt += 2;
    ans[cnt]++;
  }
  for (int i = 0; i < int(9); i++) printf("%d%c", ans[i], i == 8 ? '\n' : ' ');
}
