#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int maxm = 1e6 + 10;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-7;
const int mod = 1e9 + 7;
int x[maxn], y[maxn], c[maxn], r[maxn], lc[maxn], rc[maxn];
int bx[maxn], by[maxn], blc[maxn], brc[maxn], lx[maxn], ly[maxn], llc[maxn],
    lrc[maxn];
int t[10];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i <= maxn; i++) {
    bx[i] = by[i] = blc[i] = brc[i] = -inf;
    lx[i] = ly[i] = llc[i] = lrc[i] = inf;
  }
  for (int i = 1; i <= m; i++) {
    cin >> x[i] >> y[i];
    c[x[i]]++;
    r[y[i]]++;
    lc[x[i] + y[i]]++;
    rc[x[i] - y[i] + n]++;
    bx[x[i]] = max(bx[x[i]], y[i]);
    lx[x[i]] = min(lx[x[i]], y[i]);
    by[y[i]] = max(by[y[i]], x[i]);
    ly[y[i]] = min(ly[y[i]], x[i]);
    blc[x[i] + y[i]] = max(blc[x[i] + y[i]], x[i]);
    llc[x[i] + y[i]] = min(llc[x[i] + y[i]], x[i]);
    brc[x[i] - y[i] + n] = max(brc[x[i] - y[i] + n], x[i]);
    lrc[x[i] - y[i] + n] = min(lrc[x[i] - y[i] + n], x[i]);
  }
  for (int i = 1; i <= m; i++) {
    int ans = 0;
    if (c[x[i]] == 2) ans++;
    if (c[x[i]] > 2) {
      if (y[i] == bx[x[i]] || y[i] == lx[x[i]])
        ans++;
      else
        ans += 2;
    }
    if (r[y[i]] == 2) ans++;
    if (r[y[i]] > 2) {
      if (x[i] == by[y[i]] || x[i] == ly[y[i]])
        ans++;
      else
        ans += 2;
    }
    if (lc[x[i] + y[i]] == 2) ans++;
    if (lc[x[i] + y[i]] > 2) {
      if (x[i] == blc[x[i] + y[i]] || x[i] == llc[x[i] + y[i]])
        ans++;
      else
        ans += 2;
    }
    if (rc[x[i] - y[i] + n] == 2) ans++;
    if (rc[x[i] - y[i] + n] > 2) {
      if (x[i] == brc[x[i] - y[i] + n] || x[i] == lrc[x[i] - y[i] + n])
        ans++;
      else
        ans += 2;
    }
    t[ans]++;
  }
  for (int i = 0; i < 8; i++) cout << t[i] << ' ';
  cout << t[8] << endl;
  return 0;
}
