#include <bits/stdc++.h>
using namespace std;
long long colmin[100002], colmax[100002];
long long rowmin[100002], rowmax[100002];
long long d1min[200002], d1max[200002];
long long d2min[200002], d2max[200002];
long long queens[100002][2];
long long anscnt[9];
int main() {
  long long n, m;
  cin >> m >> n;
  for (long long i = 1; i <= 100000; i++) {
    colmin[i] = 100001;
    rowmin[i] = 100001;
  }
  for (long long i = 1; i <= 200000; i++) {
    d1min[i] = 100001;
    d2min[i] = 100001;
  }
  for (long long i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    queens[i][0] = a;
    queens[i][1] = b;
    colmin[b] = min(colmin[b], a);
    colmax[b] = max(colmax[b], a);
    rowmin[a] = min(rowmin[a], b);
    rowmax[a] = max(rowmax[a], b);
    d1min[a - b + 100001] = min(d1min[a - b + 100001], a);
    d1max[a - b + 100001] = max(d1max[a - b + 100001], a);
    d2min[m - a - b + 100001] = min(d2min[m - a - b + 100001], a);
    d2max[m - a - b + 100001] = max(d2max[m - a - b + 100001], a);
  }
  for (long long i = 0; i < n; i++) {
    long long a, b;
    a = queens[i][0];
    b = queens[i][1];
    long long ans = 0;
    ans = ans + (a != colmin[b]);
    ans = ans + (a != colmax[b]);
    ans = ans + (b != rowmin[a]);
    ans = ans + (b != rowmax[a]);
    ans = ans + (a != d1min[a - b + 100001]);
    ans = ans + (a != d1max[a - b + 100001]);
    ans = ans + (a != d2min[m - a - b + 100001]);
    ans = ans + (a != d2max[m - a - b + 100001]);
    anscnt[ans]++;
  }
  for (long long i = 0; i <= 8; i++) {
    cout << anscnt[i] << " ";
  }
  cout << endl;
  return 0;
}
