#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e18;
const long long mod = (long long)1e9 + 7;
const double eps = (double)1e-9;
const double pi = acos(-1.0);
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};
const int N = 200500;
int d1min[N], d1max[N];
int d2min[N], d2max[N];
int rowmin[N], rowmax[N];
int colmin[N], colmax[N];
int n, m, x[N], y[N], ans[9];
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n + n - 1; i++)
    rowmin[i] = colmin[i] = d1min[i] = d2min[i] = N;
  for (int i = 1; i <= m; i++) {
    cin >> x[i] >> y[i];
    rowmin[x[i]] = min(rowmin[x[i]], y[i]);
    rowmax[x[i]] = max(rowmax[x[i]], y[i]);
    colmin[y[i]] = min(colmin[y[i]], x[i]);
    colmax[y[i]] = max(colmax[y[i]], x[i]);
    d1min[x[i] + y[i] - 1] = min(d1min[x[i] + y[i] - 1], y[i]);
    d1max[x[i] + y[i] - 1] = max(d1max[x[i] + y[i] - 1], y[i]);
    d2min[n - x[i] + y[i]] = min(d2min[n - x[i] + y[i]], y[i]);
    d2max[n - x[i] + y[i]] = max(d2max[n - x[i] + y[i]], y[i]);
  }
  for (int i = 1; i <= m; i++) {
    int cnt = 0;
    cnt += rowmin[x[i]] < y[i];
    cnt += rowmax[x[i]] > y[i];
    cnt += colmin[y[i]] < x[i];
    cnt += colmax[y[i]] > x[i];
    cnt += d1min[x[i] + y[i] - 1] < y[i];
    cnt += d1max[x[i] + y[i] - 1] > y[i];
    cnt += d2min[n - x[i] + y[i]] < y[i];
    cnt += d2max[n - x[i] + y[i]] > y[i];
    ans[cnt]++;
  }
  for (int i = 0; i <= 8; i++) cout << ans[i] << " ";
  return 0;
}
