#include <bits/stdc++.h>
using namespace std;
const long long int sz = 2e5 + 2;
long long int n, m;
long long int r, c;
long long int rcnt[sz], ccnt[sz], ld[sz], rd[sz];
long long int mn[4][sz];
long long int mx[4][sz];
long long int ans[9], temp;
vector<pair<long long int, long long int>> pts;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < 9; i++) ans[i] = 0;
  for (int i = 1; i < sz; i++) {
    for (int j = 0; j < 4; j++) mn[j][i] = 1e18, mx[j][i] = -1;
  }
  for (int i = 0; i < m; i++) {
    cin >> r >> c;
    pts.push_back({r, c});
    rcnt[r]++;
    mx[0][r] = max(mx[0][r], c);
    mn[0][r] = min(mn[0][r], c);
    ccnt[c]++;
    mx[1][c] = max(mx[1][c], r);
    mn[1][c] = min(mn[1][c], r);
    rd[r + c]++;
    mx[2][r + c] = max(mx[2][r + c], r);
    mn[2][r + c] = min(mn[2][r + c], r);
    ld[n - c + 1 + r]++;
    mx[3][n - c + 1 + r] = max(mx[3][n - c + 1 + r], r);
    mn[3][n - c + 1 + r] = min(mn[3][n - c + 1 + r], r);
  }
  for (auto it : pts) {
    temp = 0;
    r = it.first;
    c = it.second;
    if (rcnt[r] > 1) {
      if (c == mx[0][r] || c == mn[0][r])
        temp++;
      else
        temp += 2;
    }
    if (ccnt[c] > 1) {
      if (r == mx[1][c] || r == mn[1][c])
        temp++;
      else
        temp += 2;
    }
    if (rd[r + c] > 1) {
      if (r == mx[2][r + c] || r == mn[2][r + c])
        temp++;
      else
        temp += 2;
    }
    if (ld[n - c + 1 + r] > 1) {
      if (r == mx[3][n - c + 1 + r] || r == mn[3][n - c + 1 + r])
        temp++;
      else
        temp += 2;
    }
    ans[temp]++;
  }
  for (int i = 0; i < 9; i++) cout << ans[i] << " ";
  return 0;
}
